df50b6b680
Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
675 B
TypeScript
23 lines
675 B
TypeScript
import { createRoot } from 'react-dom/client';
|
|
import { App } from './App.tsx';
|
|
import './styles.css';
|
|
|
|
const rootEl = document.getElementById('root');
|
|
if (!rootEl) {
|
|
document.body.innerHTML = '<pre style="color:#f66;padding:24px">#root missing</pre>';
|
|
} else {
|
|
try {
|
|
createRoot(rootEl).render(<App />);
|
|
} catch (err) {
|
|
rootEl.innerHTML = `<pre style="color:#f66;padding:24px;white-space:pre-wrap">${String(err)}</pre>`;
|
|
console.error(err);
|
|
}
|
|
}
|
|
|
|
window.addEventListener('error', (e) => {
|
|
console.error('window.error', e.error || e.message);
|
|
});
|
|
window.addEventListener('unhandledrejection', (e) => {
|
|
console.error('unhandledrejection', e.reason);
|
|
});
|