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

Viewed 981

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.

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 />
)}
Related