@mocanvas/editor · class

ErrorBoundary

declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState>

Catches a render-time throw in its subtree and renders fallback instead.

Class component because that is the only form React gives an error boundary; there is no hook equivalent.


Methods · 3

componentDidCatch(error: unknown, info: ErrorInfo): void
static getDerivedStateFromError(error: unknown): ErrorBoundaryState
render(): ReactNode

Properties · 1

state: ErrorBoundaryState

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.