I'm trying to have a function run only when the contentState itself has changed, not just the editorState.
My idea right now would be to store the old contentState as a string and compare it to the new contentState as a string, but this seems awfully wasteful to be converting states to strings and comparing them. Is there a better way?
you can simply compare the value of your
old state and the value of your
new state you don't have to
convert it to
EDIT: and here is a concept about react
state that you don't have worry about a
large state object as best practices recommend to do that way
stateis held in a
large object. It’s just object referencing a few other objects. Nothing large about it.