0

Use simpler example for ErrorBoundary

This commit is contained in:
Gabe Kangas 2023-03-14 17:30:31 -07:00
parent 97e4641054
commit cb22147ddb
No known key found for this signature in database
GPG Key ID: 4345B2060657F330

View File

@ -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'; import { ErrorBoundary } from 'react-error-boundary';
<ErrorBoundary <ErrorBoundary
// eslint-disable-next-line react/no-unstable-nested-components fallbackRender={({ error, resetErrorBoundary }) => (
fallbackRender={({ error: e, resetErrorBoundary }) => ( <ComponentError
<ComponentError componentName="DesktopContent"
componentName="BrowserNotifyModal" message={error.message}
message={e.message} retryFunction={resetErrorBoundary}
retryFunction={resetErrorBoundary} />
/> )}
)} >
> <YourComponent />
<YourFunctionality/> </ErrorBoundary>
</ErrorBoundary
``` ```
## Storybook ## Storybook