@mocanvas/editor · class
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): voidstatic getDerivedStateFromError(error: unknown): ErrorBoundaryStaterender(): ReactNodeProperties · 1
state: ErrorBoundaryStatemocanvas 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.