UNPKG

701 BTypeScriptView Raw
1import * as React from 'react';
2interface ErrorBoundaryProps {
3 message?: React.ReactNode;
4 description?: React.ReactNode;
5 children?: React.ReactNode;
6 id?: string;
7}
8interface ErrorBoundaryStates {
9 error?: Error | null;
10 info?: {
11 componentStack?: string;
12 };
13}
14declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryStates> {
15 state: {
16 error: undefined;
17 info: {
18 componentStack: string;
19 };
20 };
21 componentDidCatch(error: Error | null, info: object): void;
22 render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
23}
24export default ErrorBoundary;