import { Suspense, lazy, Component, ErrorInfo, ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; const App = lazy(() => import('./App')); interface ErrorBoundaryProps { children: ReactNode; } interface ErrorBoundaryState { hasError: boolean; error?: Error; } class ErrorBoundary extends Component { constructor(props: ErrorBoundaryProps) { super(props); this.state = { hasError: false }; } static getDerivedStateFromError(error: Error): ErrorBoundaryState { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error('ErrorBoundary caught:', error, errorInfo); } render() { if (this.state.hasError) { return (

Something went wrong

{this.state.error?.message}
); } return this.props.children; } } const LoadingSkeleton = () => (
); const container = document.getElementById('root'); if (container) { const root = createRoot(container); root.render( }> ); }