We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd6c6c8 commit 6df0af5Copy full SHA for 6df0af5
index.html
@@ -25,7 +25,7 @@
25
<link rel="icon" href="favicon.ico" />
26
</head>
27
<body>
28
- <div id="react-root"></div>
+ <div id="root"></div>
29
<script type="module" src="./src/index.tsx"></script>
30
</body>
31
</html>
src/index.tsx
@@ -7,7 +7,13 @@ import './global.css';
7
8
import Root from './Root.js';
9
10
-createRoot(document.getElementById('react-root') as HTMLDivElement).render(
+const root = document.getElementById('root');
11
+
12
+if (!root) {
13
+ throw new Error('Could not find root element');
14
+}
15
16
+createRoot(root).render(
17
<StrictMode>
18
<TProvider defaultLocale={defaultLocale} languageFiles={languageFiles}>
19
<Root />
0 commit comments