Open
Description
Provide environment information
System:
OS: macOS 15.1.1
CPU: (10) arm64 Apple M1 Pro
Memory: 116.63 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.2.0 - ~/.nvm/versions/node/v21.2.0/bin/node
Yarn: 1.22.22 - ~/.yarn/bin/yarn
npm: 10.8.1 - ~/.nvm/versions/node/v21.2.0/bin/npm
pnpm: 9.6.0 - ~/.nvm/versions/node/v21.2.0/bin/pnpm
bun: 1.1.0 - ~/.bun/bin/bun
Describe the bug
I described the bug and the workaround in this issue.
I had a menu bar from Tiptap component I used before but I couldn't get it to work as useEditor() doesn't return proper Editor instance.
I ended up using onCreate of Editor Contet and using a state to handle editor, then I can use my menu bar.
<EditorContent
extensions={extensions}
onCreate={({ editor }) => {
console.log("Editor created");
setEditor(editor);
}}
...
>
I need editor
in other parts as well but haven't found an easier/better way to do it than lifting up the state.
Link to reproduction
.
To reproduce
Try using useEditor
in your project and log the results. Using useEffect
didn't help either.
Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels
Activity