Skip to content

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

Merged
merged 2 commits into from
Feb 23, 2025

Conversation

YousefED
Copy link
Collaborator

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:

Copy link

vercel bot commented Feb 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Feb 22, 2025 5:17pm
blocknote-website ✅ Ready (Inspect) Visit Preview Feb 22, 2025 5:17pm

Comment on lines 191 to 198
{!editor.headless && (
<>
<Portals contentComponent={portalManager} />
{doRenderEditor ? (
<BlockNoteViewEditor>{children}</BlockNoteViewEditor>
) : (
children
)}
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, see update

@YousefED YousefED mentioned this pull request Feb 22, 2025
38 tasks
Copy link
Contributor

@nperez0111 nperez0111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks good

@YousefED YousefED merged commit 454a91c into main Feb 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants