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: docs/core/api/AsyncBoundary.md
+43-17Lines changed: 43 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,7 @@ title: '<AsyncBoundary />'
9
9
10
10
Handles loading and error conditions of Suspense.
11
11
12
-
In React 18, this will create a concurrent split, and in 16 and 17 it will show loading fallbacks. If there is an
13
-
irrecoverable API error, it will show an error fallback.
12
+
In React 18, this will create a [concurrent split](https://react.dev/reference/react/useTransition), and in 16 and 17 it will show loading fallbacks. If there is an irrecoverable error, it will show an error fallback.
14
13
15
14
:::tip
16
15
@@ -47,10 +46,13 @@ function SuspendingComponent() {
47
46
interfaceBoundaryProps {
48
47
children:React.ReactNode;
49
48
fallback?:React.ReactNode;
49
+
errorClassName?:string;
50
50
errorComponent?:React.ComponentType<{
51
51
error:NetworkError;
52
+
resetErrorBoundary: () =>void;
52
53
className?:string;
53
54
}>;
55
+
listen?: (resetListener: () =>void) => () =>void;
54
56
}
55
57
```
56
58
@@ -66,23 +68,21 @@ Component to handle caught errors
Displays a fallback component an error is thrown (including rejected [useSuspense()](./useSuspense.md)).
6
+
7
+
:::info
8
+
9
+
Reusable React error boundary component.
10
+
11
+
:::
12
+
13
+
## Usage
14
+
15
+
Place `ErrorBoundary`[at or above navigational boundaries](../getting-started/data-dependency.md#boundaries) like **pages, routes, or modals** to "catch" errors and render a fallback UI.
0 commit comments