mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Check if already rendering before flushing
Forgot to stage this before committing 54e88ed12
I don't think is currently observable but should include the guard to
protect against regressions (though this whole block will be deleted
along with legacy mode, anyway).
This commit is contained in:
@@ -1086,7 +1086,8 @@ export function flushSyncWithoutWarningIfAlreadyRendering<A, R>(
|
||||
// next event, not at the end of the previous one.
|
||||
if (
|
||||
rootWithPendingPassiveEffects !== null &&
|
||||
rootWithPendingPassiveEffects.tag === LegacyRoot
|
||||
rootWithPendingPassiveEffects.tag === LegacyRoot &&
|
||||
(executionContext & (RenderContext | CommitContext)) === NoContext
|
||||
) {
|
||||
flushPassiveEffects();
|
||||
}
|
||||
|
||||
@@ -1086,7 +1086,8 @@ export function flushSyncWithoutWarningIfAlreadyRendering<A, R>(
|
||||
// next event, not at the end of the previous one.
|
||||
if (
|
||||
rootWithPendingPassiveEffects !== null &&
|
||||
rootWithPendingPassiveEffects.tag === LegacyRoot
|
||||
rootWithPendingPassiveEffects.tag === LegacyRoot &&
|
||||
(executionContext & (RenderContext | CommitContext)) === NoContext
|
||||
) {
|
||||
flushPassiveEffects();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user