-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when updating value of Editor with api returned data it doesn't update or retender to show that data in editor, was working fine with slate-react@0.65.2 but updating version greater > 0.65.2 introduced this issue. #4710
Comments
Have the same issue, except that 0.66.5 works fine. Updated to 0.72.0, and the editor stopped updating its rendered value when value was changed dynamically (eg. get a certain value from list on click on a different element would still display the previously clicked element's value). These are all local state in a useReducer hook, though the whole "list" is fetched from an API at some point but not during the onClick event. |
Same issue here. Editor is not rendering updated value (like loaded data from previously saved file). |
I ran into this issue too and solved it this way : editor.children = content; // <--- This line does the trick
return (
<Slate
editor={editor}
value={content}
>
<Editable
renderElement={renderElement}
renderLeaf={renderLeaf}
autoFocus
readOnly={true}
/>
</Slate>
) Setting Hope this helps. |
Does it break when you add the hyperlink text in? It does not work here when I use the editor.children = value; |
This is driving me insane. |
You can either manually call onChange after setting the editor value to the new content (not recommended as this will mess with location refs etc.) or remove the old and insert the new content using |
when updating value of Editor with api returned data or load from local storage it doesn't update or retender to show that data in editor, was working fine with slate-react@0.65.2 but updating version greater > 0.65.2 introduced this issue.
The text was updated successfully, but these errors were encountered: