import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; import './src/index.css'; // Error Boundary Component interface ErrorBoundaryProps { children: React.ReactNode; } interface ErrorBoundaryState { hasError: boolean; error?: Error; } class ErrorBoundary extends React.Component { public state: ErrorBoundaryState; public props: ErrorBoundaryProps; constructor(props: ErrorBoundaryProps) { super(props); this.props = props; this.state = { hasError: false }; } static getDerivedStateFromError(error: Error): ErrorBoundaryState { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { console.error('Application error:', error, errorInfo); } render(): React.ReactNode { if (this.state.hasError) { return (

Ein Fehler ist aufgetreten

Die Anwendung konnte nicht geladen werden. Bitte überprüfen Sie die Browser-Konsole für Details.

Technische Details
              {this.state.error?.toString()}
            
); } return this.props.children; } } const rootElement = document.getElementById('root'); if (!rootElement) { throw new Error("Could not find root element to mount to"); } const root = ReactDOM.createRoot(rootElement); root.render( );