question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing customStyleMap doesn’t trigger re-render until contentState is changed

See original GitHub issue

Do 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:open
  • Created 7 years ago
  • Reactions:4
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
fisxcommented, May 17, 2017

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… 😃

0reactions
fisxcommented, Feb 25, 2018

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.

git log -r 7b1752581876a5061f738bce29e87bede516c498..HEAD

I’ll keep reading this, but I won’t be able to do much more than comment. Good luck! (-:

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found