Browse Source

Use simpler example for ErrorBoundary

pull/2826/head
Gabe Kangas 2 years ago
parent
commit
cb22147ddb
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
  1. 21
      web/components/_COMPONENT_HOW_TO.md

21
web/components/_COMPONENT_HOW_TO.md

@ -78,17 +78,16 @@ The `ComponentError` component is a pre-built error state that can be used to di @@ -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…
Cancel
Save