import React, { Component, type ErrorInfo, type ReactNode } from "react"; interface Props { children?: ReactNode; } interface State { hasError: boolean; error: Error | null; } /** * A React Error Boundary component that catches JavaScript errors in its child component tree. * * @remarks * This component logs errors to the console and displays a fallback UI when an error occurs. * It is used to prevent the entire application from crashing due to an error in a specific route or component. */ export declare class ErrorBoundary extends Component { state: State; /** * Updates the state when an error is thrown in a descendant component. * * @param error - The error that was thrown. * @returns The new state object. */ static getDerivedStateFromError(error: Error): State; /** * Logs error information when an error is caught. * * @param error - The error that was thrown. * @param errorInfo - Component stack trace information. */ componentDidCatch(error: Error, errorInfo: ErrorInfo): void; render(): string | number | bigint | boolean | Iterable | Promise> | Iterable | null | undefined> | React.JSX.Element | null | undefined; } export default ErrorBoundary;