mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-18 13:17:49 +08:00
8c6751f0c6
* chore: add precommit hook for eslint fixes, fix linting issues * chore: add eslint import sort plugin
26 lines
626 B
TypeScript
26 lines
626 B
TypeScript
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
|
import './style.scss'
|
|
|
|
import React from 'react'
|
|
import { createRoot } from 'react-dom/client'
|
|
|
|
import { debug, splitName } from './helper'
|
|
|
|
export default function init(name: string, source: any) {
|
|
// @ts-ignore
|
|
window.source = source
|
|
document.title = name
|
|
|
|
const [demoCategory, demoName] = splitName(name)
|
|
|
|
import(`../src/${demoCategory}/${demoName}/React/index.jsx`)
|
|
.then(module => {
|
|
const root = document.getElementById('app')
|
|
|
|
if (root) {
|
|
createRoot(root).render(React.createElement(module.default))
|
|
}
|
|
debug()
|
|
})
|
|
}
|