Alerts in ComponentWillReceiveProps freeze the app in ios

#1

Hello,
I have an Alert in ComponentWillReceiveProps which happens according to redux status. It works fine on android but on ios, it closes immediately and the app is just frozen.

Code

componentWillReceiveProps(nextProps) {
  if (nextProps.error) {
      Alert.alert(
        'Error',
        'Your request could not be processed.Please check your data and try again later.'
      );
      this.props.resetStatus();
    }
}

Environment

The app is detached
Environment:
OS: macOS High Sierra 10.13.6
Node: 10.6.0
Yarn: 1.3.2
npm: 6.1.0
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz => 0.55.2

#2

Hey @islam_elgohary,

As this is apparently a React Native issue, the best course of action here would to create a minimal, reproducible example of the issue and post it in the issues on the RN github repo! https://github.com/facebook/react-native/issues

Cheers,

Adam

closed #3

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.