- Adds `ErrorBoundary` component to catch unhandled React exceptions - Prevents UI crashes (White Screen of Death) - Ensures stack traces are not leaked to the user (Security Enhancement) - Wraps `App` in `main.tsx` - Adds tests verifying fallback UI and absence of error details in DOM Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
13 lines
308 B
TypeScript
13 lines
308 B
TypeScript
import { StrictMode } from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
import { App } from './App';
|
|
import { ErrorBoundary } from './components/layout';
|
|
|
|
createRoot(document.getElementById('root')!).render(
|
|
<StrictMode>
|
|
<ErrorBoundary>
|
|
<App />
|
|
</ErrorBoundary>
|
|
</StrictMode>
|
|
);
|