diff --git a/src/main.ts b/src/main.ts index 1210f23..897a2a0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,7 +15,11 @@ const getRootElement = (id: string): HTMLElement => { return element } -const vdom = await init() -const rootElement = getRootElement('root') +const startApp = async () => { + const vdom = await init() + const rootElement = getRootElement('root') -ReactDOM.createRoot(rootElement).render(vdom) + ReactDOM.createRoot(rootElement).render(vdom) +} + +startApp()