diff --git a/packages/react-reconciler/src/ReactFiberHydrationContext.new.js b/packages/react-reconciler/src/ReactFiberHydrationContext.new.js index 7f1876f1062b..3886b35861a2 100644 --- a/packages/react-reconciler/src/ReactFiberHydrationContext.new.js +++ b/packages/react-reconciler/src/ReactFiberHydrationContext.new.js @@ -87,7 +87,7 @@ let isHydrating: boolean = false; // this flag allows for warning supression when we expect there to be mismatches due to // earlier mismatches or a suspended fiber. -let didSuspendOrError: boolean = false; +let didSuspendOrErrorDEV: boolean = false; // Hydration errors that were thrown inside this boundary let hydrationErrors: Array | null = null; @@ -104,7 +104,7 @@ function warnIfHydrating() { export function markDidThrowWhileHydratingDEV() { if (__DEV__) { - didSuspendOrError = true; + didSuspendOrErrorDEV = true; } } @@ -120,7 +120,7 @@ function enterHydrationState(fiber: Fiber): boolean { hydrationParentFiber = fiber; isHydrating = true; hydrationErrors = null; - didSuspendOrError = false; + didSuspendOrErrorDEV = false; return true; } @@ -138,7 +138,7 @@ function reenterHydrationStateFromDehydratedSuspenseInstance( hydrationParentFiber = fiber; isHydrating = true; hydrationErrors = null; - didSuspendOrError = false; + didSuspendOrErrorDEV = false; if (treeContext !== null) { restoreSuspendedTreeContext(fiber, treeContext); } @@ -203,7 +203,7 @@ function deleteHydratableInstance( function warnNonhydratedInstance(returnFiber: Fiber, fiber: Fiber) { if (__DEV__) { - if (didSuspendOrError) { + if (didSuspendOrErrorDEV) { // Inside a boundary that already suspended. We're currently rendering the // siblings of a suspended node. The mismatch may be due to the missing // data, so it's probably a false positive. @@ -454,7 +454,7 @@ function prepareToHydrateHostInstance( } const instance: Instance = fiber.stateNode; - const shouldWarnIfMismatchDev = !didSuspendOrError; + const shouldWarnIfMismatchDev = !didSuspendOrErrorDEV; const updatePayload = hydrateInstance( instance, fiber.type, @@ -484,7 +484,7 @@ function prepareToHydrateHostTextInstance(fiber: Fiber): boolean { const textInstance: TextInstance = fiber.stateNode; const textContent: string = fiber.memoizedProps; - const shouldWarnIfMismatchDev = !didSuspendOrError; + const shouldWarnIfMismatchDev = !didSuspendOrErrorDEV; const shouldUpdate = hydrateTextInstance( textInstance, textContent, @@ -663,7 +663,7 @@ function resetHydrationState(): void { hydrationParentFiber = null; nextHydratableInstance = null; isHydrating = false; - didSuspendOrError = false; + didSuspendOrErrorDEV = false; } export function upgradeHydrationErrorsToRecoverable(): void { diff --git a/packages/react-reconciler/src/ReactFiberHydrationContext.old.js b/packages/react-reconciler/src/ReactFiberHydrationContext.old.js index 043ed02e37e8..d8583913aef7 100644 --- a/packages/react-reconciler/src/ReactFiberHydrationContext.old.js +++ b/packages/react-reconciler/src/ReactFiberHydrationContext.old.js @@ -87,7 +87,7 @@ let isHydrating: boolean = false; // this flag allows for warning supression when we expect there to be mismatches due to // earlier mismatches or a suspended fiber. -let didSuspendOrError: boolean = false; +let didSuspendOrErrorDEV: boolean = false; // Hydration errors that were thrown inside this boundary let hydrationErrors: Array | null = null; @@ -104,7 +104,7 @@ function warnIfHydrating() { export function markDidThrowWhileHydratingDEV() { if (__DEV__) { - didSuspendOrError = true; + didSuspendOrErrorDEV = true; } } @@ -120,7 +120,7 @@ function enterHydrationState(fiber: Fiber): boolean { hydrationParentFiber = fiber; isHydrating = true; hydrationErrors = null; - didSuspendOrError = false; + didSuspendOrErrorDEV = false; return true; } @@ -138,7 +138,7 @@ function reenterHydrationStateFromDehydratedSuspenseInstance( hydrationParentFiber = fiber; isHydrating = true; hydrationErrors = null; - didSuspendOrError = false; + didSuspendOrErrorDEV = false; if (treeContext !== null) { restoreSuspendedTreeContext(fiber, treeContext); } @@ -203,7 +203,7 @@ function deleteHydratableInstance( function warnNonhydratedInstance(returnFiber: Fiber, fiber: Fiber) { if (__DEV__) { - if (didSuspendOrError) { + if (didSuspendOrErrorDEV) { // Inside a boundary that already suspended. We're currently rendering the // siblings of a suspended node. The mismatch may be due to the missing // data, so it's probably a false positive. @@ -454,7 +454,7 @@ function prepareToHydrateHostInstance( } const instance: Instance = fiber.stateNode; - const shouldWarnIfMismatchDev = !didSuspendOrError; + const shouldWarnIfMismatchDev = !didSuspendOrErrorDEV; const updatePayload = hydrateInstance( instance, fiber.type, @@ -484,7 +484,7 @@ function prepareToHydrateHostTextInstance(fiber: Fiber): boolean { const textInstance: TextInstance = fiber.stateNode; const textContent: string = fiber.memoizedProps; - const shouldWarnIfMismatchDev = !didSuspendOrError; + const shouldWarnIfMismatchDev = !didSuspendOrErrorDEV; const shouldUpdate = hydrateTextInstance( textInstance, textContent, @@ -663,7 +663,7 @@ function resetHydrationState(): void { hydrationParentFiber = null; nextHydratableInstance = null; isHydrating = false; - didSuspendOrError = false; + didSuspendOrErrorDEV = false; } export function upgradeHydrationErrorsToRecoverable(): void {