Changing customStyleMap doesn’t trigger re-render until contentState is changed
See original GitHub issueDo you want to request a feature or report a bug? Bug.
What is the current behavior?
After customStyleMap
is changed, nothing happens until contentState
is changed.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem…
Check it out here: https://jsfiddle.net/m6z0xn4r/125/
What is the expected behavior?
#52 suggests that this exact problem has been cleared up. Regression?? Or am I not understanding how to do the thing?
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js? Latest, macOS, seems like all browsers. Dunno about previous versions.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Why is useState not triggering re-render? - Stack Overflow
Based on this code, it seems that the input should contain the number 0 to start, and any time it is changed, the...
Read more >Re-rendering Components in ReactJS - GeeksforGeeks
Re-render can be caused due to any of the three reasons listed: ... Each time the count button is clicked state change is...
Read more >Editor Component - Draft.js
The onChange function to be executed by the Editor when edits and selection changes occur. Presentation (Optional)#. placeholder #. Copy.
Read more >5 Ways to Avoid React Component Re-Renderings
Memoization enables your code to re-render components only if there's a change in the props. With this technique, developers can avoid unnecessary ...
Read more >Draft-js - Saving data to the server - React Rocket
convertToRaw converts ContentState to raw JS Object. So let's say we're writing a document editor and whenever change our content, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
oh i see, thanks again.
(i am touching draft through a haskell binding in which the comparison works on the values not pointers, or at least that’s what i hope. javascript confuses me… 😃
thanks @flarnie, this is very helpful! 😃
unfortunately, this issue is deep down my list at the moment.
@slavikhard as you seem to be interested in this, is there anything that’s missing from https://github.com/facebook/draft-js/compare/master...liqula:999-fix-leaf-shouldupdate that you would need from me in order to be able to make a PR?
Here’s the relevant commits. You probably want to drop 8c16719ca5a7e2559bad548eece2e1e00e7032f2 to make it easier to read / rebase.
I’ll keep reading this, but I won’t be able to do much more than comment. Good luck! (-: