mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 11:49:02 +08:00
Queue flushSync microtask (#3533)
Do the same thing as https://github.com/ueberdosis/tiptap/pull/3188
This commit is contained in:
parent
26c349848e
commit
aa4389883a
@ -79,7 +79,9 @@ export class PureEditorContent extends React.Component<EditorContentProps, Edito
|
|||||||
// lifecycle methods, and React doesn't allow calling flushSync from inside
|
// lifecycle methods, and React doesn't allow calling flushSync from inside
|
||||||
// a lifecycle method.
|
// a lifecycle method.
|
||||||
if (this.initialized) {
|
if (this.initialized) {
|
||||||
flushSync(fn)
|
queueMicrotask(() => {
|
||||||
|
flushSync(fn)
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
fn()
|
fn()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user