-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.tsx
More file actions
26 lines (22 loc) · 701 Bytes
/
Copy pathindex.tsx
File metadata and controls
26 lines (22 loc) · 701 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
26
import { StrictMode } from 'react';
// Preload critical fonts as early as possible
import '@app/assets/fonts-preload';
import '@app/assets/index.css';
import { createRoot } from 'react-dom/client';
import App from '@app/App';
const rootElement = document.getElementById('root');
if (!rootElement) {
throw new Error("Could not find root element to mount to");
}
const root = createRoot(rootElement);
root.render(
<StrictMode>
<App />
</StrictMode>
);
// Register a minimal service worker in production builds only
if ('serviceWorker' in navigator && import.meta.env.PROD) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js').catch(() => {});
});
}