import * as React from 'react'; import { ErrorInfo, PropsWithChildren } from 'react'; type ErrorBoundaryProps = PropsWithChildren<{ onError?: (error: Error, errorInfo: ErrorInfo) => void; }>; interface ErrorBoundaryState { hasError: boolean; } declare class ErrorBoundary extends React.Component { state: ErrorBoundaryState; static getDerivedStateFromError(_: Error): ErrorBoundaryState; componentDidCatch(error: Error, errorInfo: ErrorInfo): void; render(): React.ReactNode; } export default ErrorBoundary;