diff --git a/src/main.tsx b/src/main.tsx index 1256772..9c9c6ac 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,6 +1,7 @@ import '@arcgis/core/assets/esri/themes/light/main.css'; import React from 'react'; import { createRoot } from 'react-dom/client'; +import { ErrorBoundary } from 'react-error-boundary'; import App from './App'; import { AnalyticsProvider, FirebaseAppProvider, MapProvider } from './components/contexts'; import './index.css'; @@ -19,14 +20,30 @@ if (import.meta.env.VITE_FIREBASE_CONFIG) { firebaseConfig = JSON.parse(import.meta.env.VITE_FIREBASE_CONFIG); } +const MainErrorFallback = ({ error, resetErrorBoundary }: { error: Error; resetErrorBoundary: () => void }) => { + return ( +
+
+

Something went wrong

+
{error.message}
+ +
+
+ ); +}; + createRoot(document.getElementById('root')!).render( - - - - - - - + window.location.reload()}> + + + + + + + + , );