Introduction
React 16 introduced a new concept called Error Boundaries. Boundaries introduce a new way to catch JavaScript errors 🐛 in a React project.
Why do you need error boundaries?
Errors that are not caught by any error boundary will result in unmounting of the whole React component tree 😱
The problem
Unmounting the whole React component tree, means that if you don't catch errors at all the user will see an empty white screen 💥. Most of the time without having any feedback. This is not a great UX ❌, fortunately you can fix this by using Error Boundaries ✅.
The solution
Introducing error boundaries in your project 😍
react-native-error-boundary
catches JavaScript errors anywhere in their child component tree. Native errors are not handled.
Read this blog post to understand what this library can do for you: Managing React-Native crashes with Error Boundaries 👀