You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple question: how do I update a block, or even how do I add a block with text?
The API docs don't explain the logic behind methods and guides seem to be outdated, so I can't seem to find the right combination.
Here's one of the ways I tried. Guides use doc.getBlockById but that's deprecated and replaced by getBlock, so I guess paragraph.model is the right way because updateBlock expects BlockModel instead of Block that getBlock returns? In any case, this way doesn't work either.
This particular way crashes with rich-text need yText to init. error but since typings aren't giving me any errors and updateBlock is asking for text: string 🤷♂️
The text was updated successfully, but these errors were encountered:
I have a simple question: how do I update a block, or even how do I add a block with text?
The API docs don't explain the logic behind methods and guides seem to be outdated, so I can't seem to find the right combination.
Here's one of the ways I tried. Guides use
doc.getBlockById
but that's deprecated and replaced bygetBlock
, so I guessparagraph.model
is the right way because updateBlock expectsBlockModel
instead ofBlock
thatgetBlock
returns? In any case, this way doesn't work either.This particular way crashes with
rich-text need yText to init.
error but since typings aren't giving me any errors andupdateBlock
is asking fortext: string
🤷♂️The text was updated successfully, but these errors were encountered: