ErrorBoundary

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

Props#

PropTypeDefaultDescription
childrentype ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode
fallbacktype ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode
onError(error: Error, errorInfo: ErrorInfo) => void

Was this helpful?