This is an example repo This repo contains a basic react native app boilerplate code.
I have integrated both JS Exception handler and Native exception handler here to showcase how to integrate the library.
The details of how the libarary works and integration can be found here:
https://github.com/master-atul/react-native-exception-handler
To run the app:
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
JS Exceptions can be caught even when running in development mode, Since I have enabled Catching JS Exceptions during development. So for JS exceptions you can run react-native run-ios
or react-native run-android
.
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.
Few screenshots
Hope this helps people !! ✌🏻🌮