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 and aliasliao committed May 24, 2023
1 parent 5d0b05e commit af41881
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 af41881

Please sign in to comment.