import React from 'react'; import './style/boundary.less'; export interface ErrorBoundaryProps { errorTemplate?: (e: Error) => JSX.Element | JSX.Element[]; children?: JSX.Element | JSX.Element[]; } export interface ErrorBoundaryState { hasError?: boolean; error?: Error | ''; children?: JSX.Element | JSX.Element[]; } declare class ErrorBoundary extends React.Component { static getDerivedStateFromError(error: Error): { hasError: boolean; error: Error; }; static getDerivedStateFromProps(nextProps: ErrorBoundaryProps, state: ErrorBoundaryState): { children: JSX.Element | JSX.Element[] | undefined; hasError: boolean; error: undefined; } | null; state: ErrorBoundaryState; renderError: (e: Error) => JSX.Element | JSX.Element[]; render(): JSX.Element | JSX.Element[]; } export default ErrorBoundary;