$chiubaca / notes / fleeting / 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.
Edit on GitHub ✏️

Hey I'm Alex Chiu 👋. These are my notes for literally anything.

I'm using the Zettelkasten method to organise my thoughts here.

My more polished writings are published to my main blog at chiubaca.com

Follow me on: Github / X (Twitter) / Mastodon / LinkedIn