Lightweight React integration example

@dharries Thanks for this example!

Though I struggle with understanding how to properly keep state, could you help please?

So I need autosave functionality, and the most straightforward way of doing so is to keep Autosave component and editorState one level up and pass setEditorState function to ProseMirror to execute it everytime state changes. However with this approach I kind a run into infinite loops with useEffect, well because with external state Prosemirror rerenders every time it saved.

So I am trying to refactor it somehow and I run out of ideas.

1 Like