Description
I have a submit button and i use this function to handle the response. When i use the Alert.alert() api, it automatically closes expo without any warning.
Expected Behavior
I expected to see an alert pop up on the simulator What action did you perform, and what did you expect to happen?
Observed Behavior
Expo immediately closes on the phone or simulator
Environment
Expo CLI 3.13.1 environment info: System: OS: macOS 10.15.3 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.14.0 - /usr/local/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.13.7 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild npmPackages: expo: ^36.0.0 => 36.0.2 react: 16.9.0 => 16.9.0 react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4 npmGlobalPackages: expo-cli: 3.13.1
Iphone 11 simulator and also on expo physical iphone x
Reproducible Demo
import {Alert, Button, } from 'react-native';
const submitButton = () => {
Alert.alert('error', [{ text: 'Ok' }]);
}
//inside return func
<Button title="Submit" onPress={submitButton} />