Open OsamaShabrez opened 7 years ago
+1
I also have this issue
@OsamaShabrez @zane-c @marcofugaro hey all, I too was having similar issues and threw up react-codemirror2 which doesn't seem to suffer from this. I'm planning to maintain it moving forward. Feel free to open up an issue on the repo should anything seem off and I'll be on it 😎
here's the offending commit https://github.com/JedWatson/react-codemirror/commit/339b5975724cde338301f4c6842f2d52b4773e76
ugly hack:
<CodeMirror ref={el => this.cm = el} ... />
and then in the code where you want to update:
this.cm.codeMirror.setValue(newValue)
@JedWatson can you take a look at https://github.com/JedWatson/react-codemirror/commit/339b5975724cde338301f4c6842f2d52b4773e76 and possibly just reverse it as @jaredly pointed out?
I just spent an hour chasing this bug. 🤦🏻♀️ Thanks for the (working) fork, @scniro!
If CodeMirror value is changed at the backend, directly in the store the component does not reflect the latest changes.
There is no way I have found so far that can force update the component. Any help would be greatly appreciated.