fix: top level await

This commit is contained in:
Aidar Shaikhutdin @makeweb.space 2023-05-04 21:27:14 +06:00
parent 5519769c73
commit 24278eb9b6

View File

@ -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()