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
A reusable React error boundary component.
Wrap this component around other React components to "catch" errors and render a fallback UI.
ℹ️ The component provides several ways to render a fallback: fallback, fallbackRender, and FallbackComponent.
Refer to the documentation to determine which is best for your application.
ℹ️ This is a client component. You can only pass props to it that are serializeable or use it in files that have a "use client"; directive.
Required props
None
Optional props
Name
Description
onError
Optional callback to enable e.g. logging error information to a server.
@param error Error that was thrown
@param info React "component stack" identifying where the error was thrown
onReset
Optional callback to to be notified when an error boundary is "reset" so React can retry the failed render.
resetKeys
When changed, these keys will reset a triggered error boundary.
This can be useful when an error condition may be tied to some specific state (that can be uniquely identified by key).
See the the documentation for examples of how to use this prop.
fallback
Static content to render in place of an error if one is thrown.
<ErrorBoundary fallback={<div class="text-red">Something went wrong</div>} />
FallbackComponent
React component responsible for returning a fallback UI based on a thrown value.
<ErrorBoundary FallbackComponent={Fallback} />
fallbackRender
Render prop function responsible for returning a fallback UI based on a thrown value.