Skip to content

Commit

Permalink
rename warning function
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Jan 31, 2022
1 parent 3cc0d1a commit bc1ca2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/react-reconciler/src/ReactFiberCompleteWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ import {
popHydrationState,
resetHydrationState,
getIsHydrating,
hasMore,
hasUnhydratedTailNodes,
} from './ReactFiberHydrationContext.new';
import {
enableSuspenseCallback,
Expand Down Expand Up @@ -1032,6 +1032,7 @@ function completeWork(
if (
enableClientRenderFallbackOnHydrationMismatch &&
hasMore() &&
(workInProgress.mode & ConcurrentMode) !== NoMode &&
(workInProgress.flags & DidCapture) === NoFlags
) {
warnDeleteNextHydratableInstance(workInProgress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function reenterHydrationStateFromDehydratedSuspenseInstance(
return true;
}

function warnDeleteHydratableInstance(
function warnUnhydratedInstance(
returnFiber: Fiber,
instance: HydratableInstance,
) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function reenterHydrationStateFromDehydratedSuspenseInstance(
return true;
}

function warnDeleteHydratableInstance(
function warnUnhydratedInstance(
returnFiber: Fiber,
instance: HydratableInstance,
) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -578,7 +578,7 @@ function hasMore() {

function warnDeleteNextHydratableInstance(fiber: Fiber) {
if (nextHydratableInstance) {
warnDeleteHydratableInstance(fiber, nextHydratableInstance);
warnUnhydratedInstance(fiber, nextHydratableInstance);
}
}

Expand Down

0 comments on commit bc1ca2a

Please sign in to comment.