What is the best way to do Error Handling in React Native App.

Viewed 13894

There are a few approaches which people use.

1: One way is to use hoc's(Higher Order components) with global handlers using interceptors in axios.

2: Another way is to create an action creator for error and store errors in Reducer store, Fire the one action creator which is responsible for catching errors from the catch block. Currently, in most places, we have unhandled promise rejection.

Please let me know if there is any other approach to error handling, we want to show different error messages to the user for different errors. Example: Error can occur while accepting the order.

1 Answers
Related