Skip to content

Commit

Permalink
Queue flushSync microtask (ueberdosis#3533)
Browse files Browse the repository at this point in the history
Do the same thing as ueberdosis#3188
  • Loading branch information
kylealwyn authored Feb 18, 2023
1 parent 4d62727 commit 71cff5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 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 71cff5c

Please sign in to comment.