We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 768c93c commit 713d354Copy full SHA for 713d354
src/main.tsx
@@ -1,16 +1,18 @@
1
import './patch-local-storage-for-github-pages';
2
3
-import React, {StrictMode} from 'react'
4
-import { render } from 'react-dom';
5
-import App from './App'
6
-import './index.scss'
7
-import eruda from "eruda";
+import React from 'react';
+import { createRoot } from 'react-dom/client';
+import App from './App';
+import './index.scss';
+import eruda from 'eruda';
8
9
eruda.init();
10
11
-render(
12
- <StrictMode>
13
- <App />
14
- </StrictMode>,
15
- document.getElementById('root') as HTMLElement
16
-)
+const container = document.getElementById('root');
+if (!container) throw new Error('Root element not found');
+
+createRoot(container).render(
+ <React.StrictMode>
+ <App />
17
+ </React.StrictMode>
18
+);
0 commit comments