Home

Awesome

React Native Exception handler example

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:

  1. git clone https://github.com/master-atul/react-native-exception-handler-example
  2. yarn install
  3. 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

  1. App launch:
<br> <div style="text-align:center"> <img src="https://github.com/master-atul/react-native-exception-handler-example/raw/master/screens/1.png" style="width: 30%;display: inline;"> </div> <br>
  1. JS Exception:
<br> <div style="text-align:center"> <img src="https://github.com/master-atul/react-native-exception-handler-example/raw/master/screens/2.png" style="width: 30%;display: inline;"> </div> <br>
  1. Native Exception:
<br> <div style="text-align:center"> <img src="https://github.com/master-atul/react-native-exception-handler-example/raw/master/screens/3.png" style="width: 30%;display: inline;"> </div> <br>

Hope this helps people !! ✌🏻🌮