-
-
Notifications
You must be signed in to change notification settings - Fork 534
Open
Description
Here is my code. How can I resolve this error
import { useEffect, useRef } from 'react';
export default function AffineEditor() {
const box = useRef<HTMLDivElement>(null);
useEffect(() => {
// 动态 import,保证代码只在浏览器执行
import('@blocksuite/presets').then(({ PageEditor, createEmptyDoc }) => {
// 注册语句就包含在 @blocksuite/presets 的副作用里,import 一次即可
const doc = createEmptyDoc().init();
const editor = new PageEditor();
editor.doc = doc;
box.current?.appendChild(editor);
});
}, []);
return <div ref={box} style={{ height: '100vh' }} />;
}
Failed to construct 'HTMLElement': Illegal constructor
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status