Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using position: 'Absolute' and display: 'None' in React Native still renders the component

I've came across an issue in React Native and that is when using position: 'Absolute' and display: 'None' on a component, the component still renders. I should note that this happens in Android only (iOS this works as expected) Any ideas on what I should do in this case?

Thanks for your helps.

like image 804
farzan Avatar asked Apr 07 '26 15:04

farzan


1 Answers

This is an issue that was reported some time ago and unfortunately has not been resolved. You can easily work around it with conditional rendering, e.g.

{this.state.isShowingComponent && (
          <MyComponent />
)}
like image 81
Brien Crean Avatar answered Apr 10 '26 04:04

Brien Crean



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!