Handling your React errors

Michael Minchang Kim·2021년 7월 19일
0

Your website crashing and disaplying a white screen is not something you want
React 16+ offers error boundaries to help you take care of those cases
React official docs
However error boundaries are limited in catching errors.

  • Event handlers (learn more)
  • Asynchronous code (e.g. setTimeout or requestAnimationFrame callbacks)
  • Server side rendering
  • Errors thrown in the error boundary itself (rather than its children)

are not handled.

The react-error-boundary allows you to use this error boundary without having to implement everything yourself and also can be used to catch arrors in event handlers and asynchronous code.

react-error-boundary npm link
tutorial video link

profile
Soon to be the world's Best programmer ;)

0개의 댓글

관련 채용 정보