import React from 'react'; import type { JSX } from 'react'; import ErrorFallback from './ErrorFallback.js'; export interface ErrorBoundaryProps { children: React.ReactNode; /** className prop sent to fallbackComponent */ className?: string; /** Renders when an error is caught */ fallbackComponent: React.ComponentType<{ error: E; resetErrorBoundary: () => void; className?: string; }>; /** Subscription handler to reset error state on events like URL location changes */ listen?: (resetListener: () => void) => () => void; } export interface ErrorState { error?: E; } /** * Reusable React error boundary component * @see https://dataclient.io/docs/api/ErrorBoundary */ export default class ErrorBoundary extends React.Component, ErrorState> { static defaultProps: { fallbackComponent: typeof ErrorFallback; }; static getDerivedStateFromError(error: Error): { error: Error; }; private unsubscribe; state: ErrorState; componentDidMount(): void; componentDidUpdate(prevProps: Readonly>, prevState: Readonly>, snapshot?: any): void; componentWillUnmount(): void; listen(): void; unlisten(): void; render(): JSX.Element; } //# sourceMappingURL=ErrorBoundary.d.ts.map