Skip to content

Latest commit

History

History
5 lines (4 loc) 路 621 Bytes

2021-02-26.md

File metadata and controls

5 lines (4 loc) 路 621 Bytes
publish_date
2021-02-26
  • 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 using try, catch.