You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,13 @@ yarn add react-error-boundary
19
19
### `ErrorBoundary` component
20
20
Wrap an `ErrorBoundary` around other React components to "catch" errors and render a fallback UI. The component supports several ways to render a fallback (shown below).
21
21
22
+
> **Note**`ErrorBoundary` is a _client_ component. You can only pass props to it that are serializeable or use it in files that have a `"use client";` directive.
23
+
22
24
#### `ErrorBoundary` with `fallback` prop
23
25
The simplest way to render a default "something went wrong" type error message.
<ErrorBoundary fallback={<div>Something went wrong</div>}>
@@ -31,6 +35,8 @@ import { ErrorBoundary } from "react-error-boundary";
31
35
#### `ErrorBoundary` with `fallbackRender` prop
32
36
["Render prop"](https://react.dev/reference/react/Children#calling-a-render-prop-to-customize-rendering) function responsible for returning a fallback UI based on a thrown value.
@@ -149,6 +163,8 @@ function ErrorFallback({ error }) {
149
163
This package can also be used as a [higher-order component](https://legacy.reactjs.org/docs/higher-order-components.html) that accepts all of the same props as above:
0 commit comments