From bc1ca2abdd420e76a090d58b2647839aeef7e93d Mon Sep 17 00:00:00 2001 From: Marco Salazar Date: Mon, 31 Jan 2022 14:42:20 -0500 Subject: [PATCH] rename warning function --- .../react-reconciler/src/ReactFiberCompleteWork.new.js | 3 ++- .../src/ReactFiberHydrationContext.new.js | 8 ++++---- .../src/ReactFiberHydrationContext.old.js | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberCompleteWork.new.js b/packages/react-reconciler/src/ReactFiberCompleteWork.new.js index 21fd5157e872e..a487020d1e159 100644 --- a/packages/react-reconciler/src/ReactFiberCompleteWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCompleteWork.new.js @@ -130,7 +130,7 @@ import { popHydrationState, resetHydrationState, getIsHydrating, - hasMore, + hasUnhydratedTailNodes, } from './ReactFiberHydrationContext.new'; import { enableSuspenseCallback, @@ -1032,6 +1032,7 @@ function completeWork( if ( enableClientRenderFallbackOnHydrationMismatch && hasMore() && + (workInProgress.mode & ConcurrentMode) !== NoMode && (workInProgress.flags & DidCapture) === NoFlags ) { warnDeleteNextHydratableInstance(workInProgress); diff --git a/packages/react-reconciler/src/ReactFiberHydrationContext.new.js b/packages/react-reconciler/src/ReactFiberHydrationContext.new.js index a01caec609a26..8989393936c9d 100644 --- a/packages/react-reconciler/src/ReactFiberHydrationContext.new.js +++ b/packages/react-reconciler/src/ReactFiberHydrationContext.new.js @@ -127,7 +127,7 @@ function reenterHydrationStateFromDehydratedSuspenseInstance( return true; } -function warnDeleteHydratableInstance( +function warnUnhydratedInstance( returnFiber: Fiber, instance: HydratableInstance, ) { @@ -163,7 +163,7 @@ function deleteHydratableInstance( returnFiber: Fiber, instance: HydratableInstance, ) { - warnDeleteHydratableInstance(returnFiber, instance); + warnUnhydratedInstance(returnFiber, instance); const childToDelete = createFiberFromHostInstanceForDeletion(); childToDelete.stateNode = instance; childToDelete.return = returnFiber; @@ -572,13 +572,13 @@ function popHydrationState(fiber: Fiber): boolean { return true; } -function hasMore() { +function hasUnhydratedTailNodes() { return isHydrating && nextHydratableInstance !== null; } function warnDeleteNextHydratableInstance(fiber: Fiber) { if (nextHydratableInstance) { - warnDeleteHydratableInstance(fiber, nextHydratableInstance); + warnUnhydratedInstance(fiber, nextHydratableInstance); } } diff --git a/packages/react-reconciler/src/ReactFiberHydrationContext.old.js b/packages/react-reconciler/src/ReactFiberHydrationContext.old.js index 283ecb69c027a..456008cd0f3d6 100644 --- a/packages/react-reconciler/src/ReactFiberHydrationContext.old.js +++ b/packages/react-reconciler/src/ReactFiberHydrationContext.old.js @@ -127,7 +127,7 @@ function reenterHydrationStateFromDehydratedSuspenseInstance( return true; } -function warnDeleteHydratableInstance( +function warnUnhydratedInstance( returnFiber: Fiber, instance: HydratableInstance, ) { @@ -163,7 +163,7 @@ function deleteHydratableInstance( returnFiber: Fiber, instance: HydratableInstance, ) { - warnDeleteHydratableInstance(returnFiber, instance); + warnUnhydratedInstance(returnFiber, instance); const childToDelete = createFiberFromHostInstanceForDeletion(); childToDelete.stateNode = instance; childToDelete.return = returnFiber; @@ -578,7 +578,7 @@ function hasMore() { function warnDeleteNextHydratableInstance(fiber: Fiber) { if (nextHydratableInstance) { - warnDeleteHydratableInstance(fiber, nextHydratableInstance); + warnUnhydratedInstance(fiber, nextHydratableInstance); } }