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
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 afterSlateruns its content replacement.
It seems like an improvement to make initialValue an optional prop, and validate that eitherinitialValue is supplied (with all the same validation in place) or editor.children is a valid node list.
The text was updated successfully, but these errors were encountered:
The
Slate
component currently requires both aneditor
and aninitialValue
, 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 actualinitialValue
content around for the whole lifetime of mySlate
component.I could also try to Render
Slate
with an emptyeditor
and a lightweight dummyinitialContent
, 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 afterSlate
runs its content replacement.It seems like an improvement to make
initialValue
an optional prop, and validate that eitherinitialValue
is supplied (with all the same validation in place) oreditor.children
is a valid node list.The text was updated successfully, but these errors were encountered: