wookoinc / react-native-popover-tooltip

ReactNative component - tooltip menu
MIT License
63 stars 63 forks source link

Use Modal's onDismiss to prevent Alert bug #22

Open Ashoat opened 6 years ago

Ashoat commented 6 years ago

There is an annoying issue in React Native where if you call an Alert right as a Modal is being closed, it can crash the UI thread: https://github.com/facebook/react-native/issues/10471

The solution, which is available in RN 0.50, is a new callback property on Modal called onDismiss. Calling Alert from within this callback is safe.

This PR makes it so this component calls the user callback from within onDismiss. It should have no impact if the user is not calling Alert.