-
Hello 👋 I have tried
But it throws this error:
and when I add the plugins this is what I get: and this is the version I am using: Thanks in advance 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This is also an issue I have.
I get the same error, I want to hydrate the Plate editor value from HTML content. |
Beta Was this translation helpful? Give feedback.
-
any updates? |
Beta Was this translation helpful? Give feedback.
-
You need to create a temporary editor object using const initialValue = useMemo(() => {
const tmpEditor = createPlateEditor({ plugins });
return deserializeHtml(tmpEditor, { element: htmlValue });
}, []; Incidentally, I strongly recommend using JSON, not serialized HTML, for storing Plate documents, since |
Beta Was this translation helpful? Give feedback.
You need to create a temporary editor object using
createPlateEditor({ plugins })
. I recommend doing so and computing the initial value inside auseMemo
.Incidentally, I strongly recommend using JSON, not serialized HTML, for storing Plate documents, since
deserializeHtml
andserializeHtml
aren't perfect inverse functions and some data may be lost in translation. Deserializing an existing document as a one-time operation and serializing HTML for read-only use are the intended uses of those functions. I just thought I'd mention that in…