Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content/docs/error-boundaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Error boundaries are React components that **catch JavaScript errors anywhere in
> * Server side rendering
> * Errors thrown in the error boundary itself (rather than its children)

> In development an error overlay might be shown on top of the screen regardless if you're using error boundaries or not. For example, create-react-app and nextjs implement this error overlay.

A class component becomes an error boundary if it defines either (or both) of the lifecycle methods [`static getDerivedStateFromError()`](/docs/react-component.html#static-getderivedstatefromerror) or [`componentDidCatch()`](/docs/react-component.html#componentdidcatch). Use `static getDerivedStateFromError()` to render a fallback UI after an error has been thrown. Use `componentDidCatch()` to log error information.

```js{7-10,12-15,18-21}
Expand Down