Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align StrictMode behaviour with production #25049

Merged
merged 12 commits into from
Aug 23, 2022
Prev Previous commit
Next Next commit
Skip over paths that don't include any insertions
  • Loading branch information
sammy-SC committed Aug 23, 2022
commit 5d28b15230d74844bf544bb081dba499221a8803
10 changes: 6 additions & 4 deletions packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -3005,10 +3005,12 @@ function recursivelyTraverseAndDoubleInvokeEffectsInDEV(
isInStrictMode: boolean,
hasPassiveEffects: boolean,
sammy-SC marked this conversation as resolved.
Show resolved Hide resolved
) {
let child = parentFiber.child;
while (child !== null) {
doubleInvokeEffectsInDEV(root, child, isInStrictMode, hasPassiveEffects);
child = child.sibling;
if (parentFiber.subtreeFlags & PlacementDEV) {
let child = parentFiber.child;
while (child !== null) {
doubleInvokeEffectsInDEV(root, child, isInStrictMode, hasPassiveEffects);
child = child.sibling;
}
}
}

Expand Down
10 changes: 6 additions & 4 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -3005,10 +3005,12 @@ function recursivelyTraverseAndDoubleInvokeEffectsInDEV(
isInStrictMode: boolean,
hasPassiveEffects: boolean,
) {
let child = parentFiber.child;
while (child !== null) {
doubleInvokeEffectsInDEV(root, child, isInStrictMode, hasPassiveEffects);
child = child.sibling;
if (parentFiber.subtreeFlags & PlacementDEV) {
let child = parentFiber.child;
while (child !== null) {
doubleInvokeEffectsInDEV(root, child, isInStrictMode, hasPassiveEffects);
child = child.sibling;
}
}
}

Expand Down