- Learning how to create a Error Boundary component for catching React errors gracefully. Currently can only be done use React class syntax as it relies on the
componentDidCatch
lifecycle event which is not available as a react hook yet. When you wrap the main<App/>
component in this error boundary you can catch any react specfic errors from all children components and render whatever we want. Note the Error Boundaries can’t catch errors in server-rendered react, errors in envent handlers or in asyncronous code. These are usually managed independantly usingtry
,catch
.