hubgit / react-prosemirror

A React component for ProseMirror
https://ow1qi.csb.app/
MIT License
248 stars 51 forks source link

render on update for redux state #12

Closed fliropp closed 3 years ago

fliropp commented 6 years ago

Somehow value inside the htmlEditor tag does to reflect updated Redux state although it re-renders on new state? I might be a little tired here, but I just can' seam to get the new state to display in the editor window

hubgit commented 6 years ago

This is probably because the Editor component doesn't yet have a componentWillReceiveProps method - it simply takes an initial value.

t3db0t commented 5 years ago

Hey, one year later—what is the status of this? I'm using Prosemirror in a react-redux project and I'm currently trying to wrap my head around it all X-)

hubgit commented 3 years ago

If you're interested in trying v2, you could add a component inside EditorProvider that uses const view = useEditorView() to get the editor view and call view.updateState(state) with the new state when needed.