How to “bubble up” errors from thrown from redux connect functions?

I want my react native app to display error messages with a toast. I want to detect errors within the root level App component using componentDidCatch so I can handle all errors in the same manner.

Currently, if one of my async actions throw an error, mapDispatchToProps can catch it. How do I “bubble” up these errors to my App component?

Alternatively, I could add a redux state for errors and set it on every async error. I can then check for this state in App . It would be cleaner, however, if I could catch all errors in componentDidCatch

This topic was automatically closed after 70 days. New replies are no longer allowed.