-
Notifications
You must be signed in to change notification settings - Fork 430
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
How to use RTE in controlled way? #403
Comments
I am also facing this issue. I want to use it with react-hook-form and it is not letting me. The cursor jump is annoying. |
This is general issue when using That's how i've done it in the past, and the only sane way to integrate Hopefully that was helpful. |
We recently migrated from Formik 1 to react-hook-form. As @naishe mentioned, she had trouble integrating react-rte into react-hook-form and so did I. Based on @callmeberzerker directions I was able to make the following code work:
Usage:
What is very important here is the initialValue. Do not use field.value. Even though this library seems pretty dead: |
Trying to use RTE with "controlled" value, but since
setValue(RichTextEditor.createValueFromString(value || "", 'html'))
happens on any value change - when I start typing cursor jumping to start of editor
I might not have value when the component initialized, so need a way to update it when value appears,
The text was updated successfully, but these errors were encountered: