mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 20:28:15 +03:00
Use simpler example for ErrorBoundary
This commit is contained in:
parent
97e4641054
commit
cb22147ddb
1 changed files with 10 additions and 11 deletions
|
@ -78,17 +78,16 @@ The `ComponentError` component is a pre-built error state that can be used to di
|
|||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
|
||||
<ErrorBoundary
|
||||
// eslint-disable-next-line react/no-unstable-nested-components
|
||||
fallbackRender={({ error: e, resetErrorBoundary }) => (
|
||||
<ComponentError
|
||||
componentName="BrowserNotifyModal"
|
||||
message={e.message}
|
||||
retryFunction={resetErrorBoundary}
|
||||
/>
|
||||
)}
|
||||
>
|
||||
<YourFunctionality/>
|
||||
</ErrorBoundary
|
||||
fallbackRender={({ error, resetErrorBoundary }) => (
|
||||
<ComponentError
|
||||
componentName="DesktopContent"
|
||||
message={error.message}
|
||||
retryFunction={resetErrorBoundary}
|
||||
/>
|
||||
)}
|
||||
>
|
||||
<YourComponent />
|
||||
</ErrorBoundary>
|
||||
```
|
||||
|
||||
## Storybook
|
||||
|
|
Loading…
Reference in a new issue