import { Component, type ErrorInfo, type ReactNode } from 'react' interface Props { children: ReactNode } interface State { error: Error | null } export class RouteErrorBoundary extends Component { state: State = { error: null } static getDerivedStateFromError(error: Error): State { return { error } } componentDidCatch(error: Error, info: ErrorInfo) { console.error('Route render error:', error, info.componentStack) } render() { if (this.state.error) { return (

Something went wrong

{this.state.error.message}

            {this.state.error.stack}
          
) } return this.props.children } }