UNPKG

ilc-adapter-react

Version:
22 lines (21 loc) 748 B
import * as React from 'react'; import { ErrorInfo, ReactNode } from 'react'; import { ErrorHandler } from 'ilc-sdk/app'; interface ErrorState { caughtError?: Error; caughtErrorInfo?: ErrorInfo; } interface Props { onError: ErrorHandler; errorBoundary?: (error: Error, errorInfo?: ErrorInfo) => ReactNode; children?: React.ReactNode; } export default class AdapterErrorBoundary extends React.Component<Props, ErrorState> { constructor(props: Props); static getDerivedStateFromError(error: Error): { caughtError: Error; }; componentDidCatch(error: Error, errorInfo: ErrorInfo): void; render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined; } export {};