In React 16, a new concept got introduced — React Error Boundaries. Error boundaries are React components that catch JavaScript errors anywhere in their child component tree. Then, they log those caught errors and display a fallback UI instead of the component tree that crashed. We'll go through different ways to handle errors in React applications.
Table of contents
The Classic 'Try and Catch' Method in ReactReact Error BoundariesError Catching in Event HandlersError Catching in setTimeout CallsJavaScript's react-error-boundary PackageUsing Your Own React BoundariesSumming Up: Get Started with React Error Handling2 Comments
Sort: