Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: flush EditorContent state changes immediately once initialized
This fixes the cursor problem described in tiptap#3200 Node views need to be rendered immediately when they're created so that the editor can correctly position the cursor. That's achieved using `flushSync` whenever a new node view renderer is added. However, `flushSync` cannot be used from inside a React component lifecycle method. By keeping an instance variable to determine if initialization has happened, we can avoid using `flushSync` from inside the `componentDidMount` and `componentDidUpdate` methods, and still call it whenever a new node view is created afterwards.
- Loading branch information