Closed riabokon-virtru closed 1 year ago
I'm not sure this is the right way to go. A consumer now needs to know how to use
draft-js
and give the propereditorState
. What is the motivation for this change? If the editorState that is passed in has external changes will it automatically sync?
I agree with you. It was a forced step. When I tried to implement a controlled mode based on a string value I faced with a problem when a caret jumped to the beginning of the text. It is a known issue in DraftJS. Also, because DraftJS is archived we can be sure that this issue will be not fixed.
We already have a small discussion around replacing DraftJS with something new. You can check this discussion starting from this message
Maybe you have some thoughts on how to implement a controlled mode in a better way?
As a solution, we can provide util functions to create EditorState
Gotcha. Replacing definitely seems like the long-term path. I like the idea of a util function for now though, I think that makes the most sense until we can swap.
Proposed Changes
value
anddefaultValue
support and replaced byeditorState
Checklist
minor
, or major