diff options
Diffstat (limited to 'subprojects/frontend/src/index.tsx')
-rw-r--r-- | subprojects/frontend/src/index.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/subprojects/frontend/src/index.tsx b/subprojects/frontend/src/index.tsx index 15b26adb..6cdbbd64 100644 --- a/subprojects/frontend/src/index.tsx +++ b/subprojects/frontend/src/index.tsx | |||
@@ -1,13 +1,16 @@ | |||
1 | import React from 'react'; | 1 | import React from 'react'; |
2 | import { render } from 'react-dom'; | 2 | import { createRoot } from 'react-dom/client'; |
3 | import CssBaseline from '@mui/material/CssBaseline'; | 3 | import CssBaseline from '@mui/material/CssBaseline'; |
4 | 4 | ||
5 | import { App } from './App'; | 5 | import { App } from './App'; |
6 | import { RootStore, RootStoreProvider } from './RootStore'; | 6 | import { RootStore, RootStoreProvider } from './RootStore'; |
7 | import { ThemeProvider } from './theme/ThemeProvider'; | 7 | import { ThemeProvider } from './theme/ThemeProvider'; |
8 | import { getLogger } from './utils/logger'; | ||
8 | 9 | ||
9 | import './index.scss'; | 10 | import './index.scss'; |
10 | 11 | ||
12 | const log = getLogger('index'); | ||
13 | |||
11 | const initialValue = `class Family { | 14 | const initialValue = `class Family { |
12 | contains Person[] members | 15 | contains Person[] members |
13 | } | 16 | } |
@@ -66,4 +69,10 @@ const app = ( | |||
66 | </RootStoreProvider> | 69 | </RootStoreProvider> |
67 | ); | 70 | ); |
68 | 71 | ||
69 | render(app, document.getElementById('app')); | 72 | const rootElement = document.getElementById('app'); |
73 | if (rootElement === null) { | ||
74 | log.error('Root element not found'); | ||
75 | } else { | ||
76 | const root = createRoot(rootElement); | ||
77 | root.render(app); | ||
78 | } | ||