fix type issues

This commit is contained in:
Dany Castillo
2022-04-11 10:16:04 +02:00
committed by bdbch
parent 7deaf97c65
commit 55d458f893

View File

@@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import ReactDOM from 'react-dom' import { createRoot } from 'react-dom/client'
import 'iframe-resizer/js/iframeResizer.contentWindow' import 'iframe-resizer/js/iframeResizer.contentWindow'
import { debug, splitName } from './helper' import { debug, splitName } from './helper'
import './style.scss' import './style.scss'
@@ -13,8 +13,11 @@ export default function init(name: string, source: any) {
import(`../src/${demoCategory}/${demoName}/React/index.jsx`) import(`../src/${demoCategory}/${demoName}/React/index.jsx`)
.then(module => { .then(module => {
// @ts-ignore waiting for https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210 const root = document.getElementById('app')
ReactDOM.createRoot(document.getElementById('app')).render(React.createElement(module.default))
if (root) {
createRoot(root).render(React.createElement(module.default))
}
debug() debug()
}) })
} }