Skip to content

Commit

Permalink
Queue flushSync microtask
Browse files Browse the repository at this point in the history
Do the same thing as #3188
  • Loading branch information
kylealwyn committed Dec 13, 2022
1 parent c187e0e commit 3d0fff9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react/src/EditorContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export class PureEditorContent extends React.Component<EditorContentProps, Edito
// lifecycle methods, and React doesn't allow calling flushSync from inside
// a lifecycle method.
if (this.initialized) {
flushSync(fn)
queueMicrotask(() => {
flushSync(fn)
})
} else {
fn()
}
Expand Down

0 comments on commit 3d0fff9

Please sign in to comment.