React-Native Controlled Modal Freezing

After painfully rebuilding the component from scratch I see there was a unsuspected culprit:

componentWillUpdate() {
    UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
    LayoutAnimation.easeInEaseOut();
  }

When I removed this code the modal worked fine but when I added it back it froze when I tried to close. This seems to be some animation conflict in iOS cant confirm for Android.

When I added a timeout of 1000ms the screen revealed a little more before it froze again.

So for now if someone has the same issue look for multiple animations being called.

Hope this helps someone, and if you have a better way of solving it please do let me know.

Regards, Emir


This is a know issue and nothing to do with your code.

See here: https://github.com/facebook/react-native/issues/16895

Tags:

React Native