ErrorBoundary

A container component that catches errors and displays a fallback UI.

Props

PropTypeDefaultDescription
childrenstring | number | bigint | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...>
fallbackstring | number | bigint | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...>
onError(error: Error, errorInfo: ErrorInfo) => void

Was this helpful?