-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
useCodeMirror overwrites content if not provided via prop #441
Comments
@mrdrogdrog Welcome to submit PR |
@jaywcjlove Very gladly! I'm creating it right now |
mrdrogdrog
added a commit
to mrdrogdrog/react-codemirror
that referenced
this issue
Dec 29, 2022
jaywcjlove
pushed a commit
that referenced
this issue
Dec 30, 2022
jaywcjlove
added a commit
that referenced
this issue
Dec 30, 2022
@mrdrogdrog upgrade |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Greetings
Hello 👋 Nice work. ❤️
Problem
In
useCodeMirror.ts
you have an effect which overwrites the document content every time the variablevalue
changes.I use the react-codemirror component in a project where the content comes from a codemirror extension and not via your prop but the effect still triggers on init and overwrites my initial content.
Prefered solution
I can't provide the content via the prop so it would be nice to disable this effect. Please don't execute the dispatch in the effect if no content (null or undefined) was given.
The text was updated successfully, but these errors were encountered: