Hey Guys?
I'm trying to serialize this HTML as defined here in the docs but I keep getting this error
This error occurs when I have this component defined
<Editable
renderElement={renderElement}
renderLeaf={renderLeaf}
placeholder="Enter some rich text…"
spellCheck
autoFocus
onKeyDown={event => {
for (const hotkey in HOTKEYS) {
if (isHotkey(hotkey, event)) {
event.preventDefault()
const mark = HOTKEYS[hotkey]
toggleMark(editor, mark)
}
}
}}
/>
Uncaught Error: Unable to find the path for Slate node: {"children":{"children":[{"type":"paragraph","children":[{"text":"This is editable "},{"text":"rich","bold":true},{"text":" text, "},{"text":"much","italic":true},{"text":" better than a "},{"text":"
Anyone knowing how to fix this?
I figured it out guys, on your initial value you should use
[
{
children: [{ text: '' }],
}
]
Instead of the one provided in the Docs because that one in the docs is the one causing the error above.
Most helpful comment
I figured it out guys, on your initial value you should use
Instead of the one provided in the Docs because that one in the docs is the one causing the error above.