How do I use a global exception handler in expo?

I’m new to react-native and expo as a Backend developer, I like to add a layer to catch all the exceptions(errors), And when the error occurred I like to display an error page to the user.

Its easy to do it in single component, Which mean I just need to defined a state represent error state, when error occurred update the state and rerender the component with error component.

But its not the ideal solution when there are tons of component and using expo router, How do I defined a global exception handler to do the same for all component ?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.