Description
The Slate
component currently requires both an editor
and an initialValue
, the latter of which is then pushed into the editor instance.
However, it's easy for me to pre-construct an editor instance that has the children
content already set, and I don't actually want to keep a reference to the actual initialValue
content around for the whole lifetime of my Slate
component.
I could also try to Render Slate
with an empty editor
and a lightweight dummy initialContent
, and then immediately replace the content with my actual content. But this seems undesirable because of unnecessary renders, and potentially complicated timing/eventing logic to ensure the update runs after Slate
runs its content replacement.
It seems like an improvement to make initialValue
an optional prop, and validate that either initialValue
is supplied (with all the same validation in place) or editor.children
is a valid node list.