a7ul / react-native-exception-handler-example

An example repo showing how to integrate react-native-exception-handler
34 stars 9 forks source link

native error doesn't trigger error view #1

Open dengue8830 opened 6 years ago

dengue8830 commented 6 years ago

i followed this

    git clone https://github.com/master-atul/react-native-exception-handler-example
    yarn install
    react-native run-ios --configuration Release or react-native run-android --variant=release

but when i press cause native error i see this

image

its that ok? I thought i should see this

image

daihovey commented 4 years ago

I think it's because the example just prints out to the console, the Alert hasn't been implemented

setNativeExceptionHandler((errorString) => {
    console.log('setNativeExceptionHandler');
});
daihovey commented 4 years ago

https://github.com/master-atul/react-native-exception-handler#customizing-setnativeexceptionhandler

dengue8830 commented 4 years ago

I guess I have to write a native exception handler in order to catch it and prevent default crash behavior?

liukefu2050 commented 4 years ago

Hence if you click on Cause JS Exception Button, you should see the error been caught straight away.

In case of native exceptions . You would need to run the app in the bundled mode using:

react-native run-ios --configuration Release

For Android you can run it using:

react-native run-android --variant=release

This runs the app on simulator in release configuration.