ProseMirror with React interaction
This is the minimal editor: Free typing, no feature. Through a useRef
code, all text update is logged in the console powered by React.
React section:
- Words : 0 words
- Characters: 0 chars
ProseMirror section:
There are two ways to handle the problem
- Intercept the
Dispatch
method on any change on ProseMirror. Optimal, but you lust be sure to not miss a command. - Use the low-level
'input'
event :editorRef.current?.addEventListener('input', handleInput);
- Use a mix:
'input'
events 🥶 don't intercept easily undo/redo