import React from 'react'; import ReactDOM from 'react-dom/client'; import { Chart, registerables } from 'chart.js'; import App from './App'; import './index.css'; // Register Chart.js components Chart.register(...registerables); // Error boundary component class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error) { return { hasError: true, error }; } componentDidCatch(error, errorInfo) { console.error('Application error:', error, errorInfo); } render() { if (this.state.hasError) { return (
Please try refreshing the page. If the problem persists, contact support.
{this.state.error?.message}
Unable to find root element. Please refresh the page.
Please try refreshing the page. If the problem persists, contact support.
${error.message}