-
-
Notifications
You must be signed in to change notification settings - Fork 530
refactor: add renderEditor boolean to BlockNoteView #1453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
{!editor.headless && ( | ||
<> | ||
<Portals contentComponent={portalManager} /> | ||
{doRenderEditor ? ( | ||
<BlockNoteViewEditor>{children}</BlockNoteViewEditor> | ||
) : ( | ||
children | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sort of brings to mind what the difference is between this renderEditor={false}
and headless
being true
on the editor. Can this be combined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, see update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks good
This PR cleans up the BlockNoteView code a bit and adds support for
renderEditor={false}
The idea is that the consumer can then "position" (render) the editor themselves, but still access the Context values that BlockNoteView is setting up.
Example usage on a different branch:
BlockNote/examples/07-collaboration/04-comments/App.tsx
Line 150 in 42cdbd1