import React from 'react' import ReactDOM from 'react-dom/client' import { BrowserRouter } from 'react-router-dom' import App from './App' import './index.css' // Ensure the root element exists const rootElement = document.getElementById('root') if (!rootElement) { throw new Error('Root element not found') } // Simple error boundary class ErrorBoundary extends React.Component<{children: React.ReactNode}, {hasError: boolean}> { constructor(props: {children: React.ReactNode}) { super(props) this.state = { hasError: false } } static getDerivedStateFromError() { return { hasError: true } } componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { console.error('Error caught by boundary:', error, errorInfo) } render() { if (this.state.hasError) { return (

Something went wrong

Please refresh the page to try again.

) } return this.props.children } } // Render the app ReactDOM.createRoot(rootElement).render( ) // Remove any loading screens setTimeout(() => { const loadingElement = document.getElementById('app-loading') if (loadingElement) { loadingElement.remove() } }, 100)