We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29af439 commit e0388baCopy full SHA for e0388ba
rstest/rspack-adapter/src/main.tsx
@@ -3,7 +3,11 @@ import ReactDOM from 'react-dom/client';
3
import App from './App.tsx';
4
import './index.css';
5
6
-ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
+const rootElement = document.getElementById('root');
7
+if (!rootElement) {
8
+ throw new Error('Failed to find the root element');
9
+}
10
+ReactDOM.createRoot(rootElement).render(
11
<React.StrictMode>
12
<App />
13
</React.StrictMode>,
0 commit comments