Add early exit to strict mode (#25235)
This commit is contained in:
parent
f2e4ff082d
commit
e52fa4c575
|
@ -3172,6 +3172,11 @@ function recursivelyTraverseAndDoubleInvokeEffectsInDEV(
|
|||
parentFiber: Fiber,
|
||||
isInStrictMode: boolean,
|
||||
) {
|
||||
if ((parentFiber.subtreeFlags & (PlacementDEV | Visibility)) === NoFlags) {
|
||||
// Parent's descendants have already had effects double invoked.
|
||||
// Early exit to avoid unnecessary tree traversal.
|
||||
return;
|
||||
}
|
||||
let child = parentFiber.child;
|
||||
while (child !== null) {
|
||||
doubleInvokeEffectsInDEV(root, child, isInStrictMode);
|
||||
|
|
|
@ -3172,6 +3172,11 @@ function recursivelyTraverseAndDoubleInvokeEffectsInDEV(
|
|||
parentFiber: Fiber,
|
||||
isInStrictMode: boolean,
|
||||
) {
|
||||
if ((parentFiber.subtreeFlags & (PlacementDEV | Visibility)) === NoFlags) {
|
||||
// Parent's descendants have already had effects double invoked.
|
||||
// Early exit to avoid unnecessary tree traversal.
|
||||
return;
|
||||
}
|
||||
let child = parentFiber.child;
|
||||
while (child !== null) {
|
||||
doubleInvokeEffectsInDEV(root, child, isInStrictMode);
|
||||
|
|
Loading…
Reference in New Issue