From 11a983fc76192037798d2f93dedf09af97f99884 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Wed, 20 Jan 2021 12:18:19 -0600 Subject: [PATCH] Remove references to Deletion flag (#20623) We no longer use the Deletion flag anywhere in the new fork, so we can stop marking it. --- packages/react-reconciler/src/ReactChildFiber.new.js | 8 +------- packages/react-reconciler/src/ReactFiberBeginWork.new.js | 4 ---- .../src/ReactFiberHydrationContext.new.js | 9 +-------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/packages/react-reconciler/src/ReactChildFiber.new.js b/packages/react-reconciler/src/ReactChildFiber.new.js index c5206e46c4899..a18f845d26ae3 100644 --- a/packages/react-reconciler/src/ReactChildFiber.new.js +++ b/packages/react-reconciler/src/ReactChildFiber.new.js @@ -13,12 +13,7 @@ import type {Fiber} from './ReactInternalTypes'; import type {Lanes} from './ReactFiberLane.new'; import getComponentName from 'shared/getComponentName'; -import { - Deletion, - ChildDeletion, - Placement, - StaticMask, -} from './ReactFiberFlags'; +import {Placement, ChildDeletion} from './ReactFiberFlags'; import { getIteratorFn, REACT_ELEMENT_TYPE, @@ -281,7 +276,6 @@ function ChildReconciler(shouldTrackSideEffects) { returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; } childToDelete.nextEffect = null; - childToDelete.flags = (childToDelete.flags & StaticMask) | Deletion; const deletions = returnFiber.deletions; if (deletions === null) { diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.new.js b/packages/react-reconciler/src/ReactFiberBeginWork.new.js index 9684efafc409c..f447ee0e3545b 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.new.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.new.js @@ -67,7 +67,6 @@ import { DidCapture, Update, Ref, - Deletion, ChildDeletion, ForceUpdateForLegacySuspense, StaticMask, @@ -2200,8 +2199,6 @@ function updateSuspensePrimaryChildren( if (currentFallbackChildFragment !== null) { // Delete the fallback child fragment currentFallbackChildFragment.nextEffect = null; - currentFallbackChildFragment.flags = - (currentFallbackChildFragment.flags & StaticMask) | Deletion; workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChildFragment; const deletions = workInProgress.deletions; if (deletions === null) { @@ -3191,7 +3188,6 @@ function remountFiber( returnFiber.firstEffect = returnFiber.lastEffect = current; } current.nextEffect = null; - current.flags = (current.flags & StaticMask) | Deletion; const deletions = returnFiber.deletions; if (deletions === null) { diff --git a/packages/react-reconciler/src/ReactFiberHydrationContext.new.js b/packages/react-reconciler/src/ReactFiberHydrationContext.new.js index f416c33b21f1b..087dd818b9a9d 100644 --- a/packages/react-reconciler/src/ReactFiberHydrationContext.new.js +++ b/packages/react-reconciler/src/ReactFiberHydrationContext.new.js @@ -24,13 +24,7 @@ import { HostRoot, SuspenseComponent, } from './ReactWorkTags'; -import { - Deletion, - ChildDeletion, - Placement, - Hydrating, - StaticMask, -} from './ReactFiberFlags'; +import {ChildDeletion, Placement, Hydrating} from './ReactFiberFlags'; import invariant from 'shared/invariant'; import { @@ -130,7 +124,6 @@ function deleteHydratableInstance( const childToDelete = createFiberFromHostInstanceForDeletion(); childToDelete.stateNode = instance; childToDelete.return = returnFiber; - childToDelete.flags = (childToDelete.flags & StaticMask) | Deletion; // This might seem like it belongs on progressedFirstDeletion. However, // these children are not part of the reconciliation list of children.