add useReactNodeView hook

This commit is contained in:
Philipp Kühn
2021-03-14 20:40:40 +01:00
parent 109bff0892
commit 380d27fe86
6 changed files with 75 additions and 13 deletions

View File

@@ -135,7 +135,6 @@ export default () => {
draggable: true,
addNodeView() {
return ReactNodeViewRenderer((props) => {
// console.log({props})
return (
<NodeViewWrapper>
<div className="heading">
@@ -156,7 +155,6 @@ export default () => {
})
}
}),
],
content: `
<h1>heading</h1>
@@ -197,6 +195,10 @@ export default () => {
return (
<div>
<div>
<button onClick={() => editor.setEditable(true)}>editable</button>
<button onClick={() => editor.setEditable(false)}>readonly</button>
</div>
<MenuBar editor={editor} />
<EditorContent editor={editor} />
</div>