From b3099a1b9077c7a9871992823e56b8d8240cc4a5 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Mon, 4 Jan 2021 21:41:48 -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;