react-prosemirror
react-prosemirror copied to clipboard
`useEditorEffect` returns stale `view` properties on first render
Hey - it's me again! 😄 Another subtle issue regarding the ReactEditorView.
We have a non-editable editor that uses node views. These node views have logic that depends on the view.editable
prop, which is accessed inside useEditorEffect
. We noticed that this property is stale and shows an incorrect value on the first render cycle.
https://github.com/nytimes/react-prosemirror/assets/46243719/9019de0e-2efc-49a2-bab1-f8a72b72a0b6
It would be great if this could be fixed so that either we have the correct values immediately or a view parameter that is null initially to indicate that the correct state is still pending.