import React, { Component, ErrorInfo, ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; import App from './App.tsx'; import './index.css'; interface ErrorBoundaryProps { children: ReactNode; } interface ErrorBoundaryState { hasError: boolean; error: Error | null; } class RootErrorBoundary extends Component { constructor(props: ErrorBoundaryProps) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error: Error): ErrorBoundaryState { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error('GAJRA PRINT Runtime caught error:', error, errorInfo); } render() { if (this.state.hasError) { return (
G

GAJRA PRINT

The application encountered a temporary display issue.

{this.state.error?.message || 'Unexpected application error'}
); } return this.props.children; } } createRoot(document.getElementById('root')!).render( );