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
React [v16](https://reactjs.org/blog/2017/09/26/react-v16.0.html) introduced the concept of [“error boundaries”](https://reactjs.org/docs/error-boundaries.html).
10
+
11
+
This component provides a simple and reusable wrapper that you can use to wrap around your components. Any rendering errors in your components hierarchy can then be gracefully handled.
12
+
13
+
# Usage
14
+
15
+
The simplest way to use `<ErrorBoundary>` is to wrap it around any component that may throw an error.
16
+
This will handle errors thrown by that component and its descendants too.
7
17
8
18
```jsx
9
19
importErrorBoundaryfrom'react-error-boundary';
@@ -13,40 +23,53 @@ import ErrorBoundary from 'react-error-boundary';
13
23
</ErrorBoundary>
14
24
```
15
25
16
-
You can react to errors (eg for logging) by providing an `onError` callback:
26
+
You can react to errors (e.g. for logging) by providing an `onError` callback:
0 commit comments