fix type issues
This commit is contained in:
@@ -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()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user