Skip to content

Commit 0bb9d51

Browse files
committed
Error management for root page
1 parent 504e701 commit 0bb9d51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/client/app/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ function App() : JSXElement {
1818
);
1919
}
2020

21-
render(() => <App/>, document.getElementById("root")!);
21+
const root = globalThis.document.getElementById("root")
22+
if (!root) {
23+
throw new Error('No root element found.')
24+
}
25+
render(() => <App/>, root);

0 commit comments

Comments
 (0)