-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.tsx
More file actions
25 lines (22 loc) · 705 Bytes
/
index.tsx
File metadata and controls
25 lines (22 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './index.css';
// Ensure no stale service worker is serving cached assets.
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then((registrations) => {
registrations.forEach((registration) => registration.unregister());
}).catch(() => {
// No-op: failure to unregister should not break app startup.
});
}
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(
<React.StrictMode>
<App />
</React.StrictMode>
);