TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
5.91k stars 386 forks source link

refactor: `contentRef` prop into `useContent` hook #789

Open matthewlipski opened 1 month ago

matthewlipski commented 1 month ago

This PR removes the hacky fix used for the contentRef prop by refactoring it into a useContent prop. Now setting the editable element in a React block is done via this hook instead of the contentRef prop.

Closes #659

TODO: There are currently a pretty big problem in that because this uses a hook which runs asynchronously, exporting to HTML does not properly serialize the content.

vercel[bot] commented 1 month ago

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

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview May 31, 2024 4:30pm
blocknote-website ✅ Ready (Inspect) Visit Preview May 31, 2024 4:30pm