0

Whenever I try to display a Modal from https://github.com/react-native-modal/react-native-modal, it will freeze the app when displayed only when running on an Android device (both physical and emulator). Any buttons or input controls are unable to be tapped on. iOS works completely fine.

For testing purposes, I made a simple modal like so:

<Modal isVisible backdropColor="black" backdropOpacity={0.8}>
    <TouchableOpacity onPress={() => { this.hideModal(); }}>
</Modal>

where hideModal is just a simple function changing the state of isVisible to false.

Doesn't matter what content I put in the modal, or even if I leave it completely empty, it will always freeze on android. Moving any of the content outside the Modal works fine. I swapped out the react-native-modal with the modal that comes with react-native, but the same issue occurs.

react-native version is 0.64.1

react-native-modal version is 11.0.1

I cannot upgrade these to the newest versions because many other parts of the app rely on these versions.

pfinferno
  • 1,779
  • 3
  • 34
  • 62

1 Answers1

0

in isVisible, inform the variable that tells you whether the modal is open or closed

<Modal isVisible={this.modalOpen} backdropColor="black">
  <TouchableOpacity onPress={() => { this.hideModal(); }}>
</Modal>

https://github.com/react-native-modal/react-native-modal/issues/523