We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5a92d81 + fa2ba02 commit 4c8e4a1Copy full SHA for 4c8e4a1
1 file changed
src/utils.ts
@@ -19,20 +19,7 @@ export function syncFlush() {
19
return {
20
apply(f: () => void) {
21
if (ready.current) {
22
- try {
23
- flushSync(f)
24
- } catch (error) {
25
- const message = error ? (error as Error).message : null
26
-
27
- if (message && (
28
- message.includes('flushSync was called from inside a lifecycle method')
29
- || message.includes('React error #187')
30
- )) {
31
- f()
32
- return
33
- }
34
- throw error
35
+ queueMicrotask(() => flushSync(f))
36
} else {
37
f()
38
}
0 commit comments