<ErrorBoundary>
Edit this pageCatches uncaught errors and renders fallback content.
Here's an example of how to use it:
If you want to customize the error message, you can pass a function as the fallback
prop. The function will be called with the error and a reset
function. The reset
function will reset the error boundary and re-render the children.
Props
Name | Type | Description |
---|---|---|
fallback | JSX.Element | ((err: any, reset: () => void) => JSX.Element) | The fallback content to render when an error is caught. |