From a6329b10508e9b27222392dc03d7867d82b2e984 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 11 Dec 2020 15:37:43 -0600 Subject: [PATCH] Don't clear static flags in resetWorkInProgress Fixes the regression test added in #20433 --- packages/react-reconciler/src/ReactFiber.new.js | 2 +- packages/react-reconciler/src/ReactFiber.old.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiber.new.js b/packages/react-reconciler/src/ReactFiber.new.js index b617bb3eeeb13..9d55634deab95 100644 --- a/packages/react-reconciler/src/ReactFiber.new.js +++ b/packages/react-reconciler/src/ReactFiber.new.js @@ -365,7 +365,7 @@ export function resetWorkInProgress(workInProgress: Fiber, renderLanes: Lanes) { // Reset the effect flags but keep any Placement tags, since that's something // that child fiber is setting, not the reconciliation. - workInProgress.flags &= Placement; + workInProgress.flags &= StaticMask | Placement; // The effect list is no longer valid. workInProgress.nextEffect = null; diff --git a/packages/react-reconciler/src/ReactFiber.old.js b/packages/react-reconciler/src/ReactFiber.old.js index a130aec76432e..76001dd757e74 100644 --- a/packages/react-reconciler/src/ReactFiber.old.js +++ b/packages/react-reconciler/src/ReactFiber.old.js @@ -365,7 +365,7 @@ export function resetWorkInProgress(workInProgress: Fiber, renderLanes: Lanes) { // Reset the effect flags but keep any Placement tags, since that's something // that child fiber is setting, not the reconciliation. - workInProgress.flags &= Placement; + workInProgress.flags &= StaticMask | Placement; // The effect list is no longer valid. workInProgress.nextEffect = null;