@@ -87,7 +87,11 @@ let isHydrating: boolean = false;
87
87
88
88
// this flag allows for warning supression when we expect there to be mismatches due to
89
89
// earlier mismatches or a suspended fiber.
90
+ < << << << packages / react-reconciler / src / ReactFiberHydrationContext . old . js
90
91
let didSuspendOrError : boolean = false ;
92
+ === === =
93
+ let didSuspendOrErrorDEV : boolean = false ;
94
+ >>> >>> > packages/react-reconciler/src/ReactFiberHydrationContext.new.js
91
95
92
96
// Hydration errors that were thrown inside this boundary
93
97
let hydrationErrors: Array< mixed > | null = null;
@@ -104,7 +108,11 @@ function warnIfHydrating() {
104
108
105
109
export function markDidThrowWhileHydratingDEV() {
106
110
if ( __DEV__ ) {
111
+ << < << << packages / react - reconciler / src / ReactFiberHydrationContext . old . js
107
112
didSuspendOrError = true ;
113
+ === = ===
114
+ didSuspendOrErrorDEV = true ;
115
+ >>> > >>> packages / react - reconciler / src / ReactFiberHydrationContext . new . js
108
116
}
109
117
}
110
118
@@ -120,7 +128,11 @@ function enterHydrationState(fiber: Fiber): boolean {
120
128
hydrationParentFiber = fiber;
121
129
isHydrating = true;
122
130
hydrationErrors = null;
131
+ < << << << packages / react-reconciler / src / ReactFiberHydrationContext . old . js
123
132
didSuspendOrError = false ;
133
+ === === =
134
+ didSuspendOrErrorDEV = false ;
135
+ >>> >>> > packages/react-reconciler/src/ReactFiberHydrationContext.new.js
124
136
return true;
125
137
}
126
138
@@ -138,7 +150,11 @@ function reenterHydrationStateFromDehydratedSuspenseInstance(
138
150
hydrationParentFiber = fiber;
139
151
isHydrating = true;
140
152
hydrationErrors = null;
153
+ < << << << packages / react-reconciler / src / ReactFiberHydrationContext . old . js
141
154
didSuspendOrError = false ;
155
+ === === =
156
+ didSuspendOrErrorDEV = false ;
157
+ >>> >>> > packages/react-reconciler/src/ReactFiberHydrationContext.new.js
142
158
if (treeContext !== null) {
143
159
restoreSuspendedTreeContext ( fiber , treeContext ) ;
144
160
}
@@ -203,7 +219,11 @@ function deleteHydratableInstance(
203
219
204
220
function warnNonhydratedInstance ( returnFiber : Fiber , fiber : Fiber ) {
205
221
if ( __DEV__ ) {
222
+ << < << << packages / react - reconciler / src / ReactFiberHydrationContext . old . js
206
223
if ( didSuspendOrError ) {
224
+ === = ===
225
+ if ( didSuspendOrErrorDEV ) {
226
+ >>> > >>> packages / react - reconciler / src / ReactFiberHydrationContext . new . js
207
227
// Inside a boundary that already suspended. We're currently rendering the
208
228
// siblings of a suspended node. The mismatch may be due to the missing
209
229
// data, so it's probably a false positive.
@@ -454,7 +474,11 @@ function prepareToHydrateHostInstance(
454
474
}
455
475
456
476
const instance: Instance = fiber.stateNode;
477
+ < << << << packages / react-reconciler / src / ReactFiberHydrationContext . old . js
457
478
const shouldWarnIfMismatchDev = ! didSuspendOrError ;
479
+ === === =
480
+ const shouldWarnIfMismatchDev = ! didSuspendOrErrorDEV ;
481
+ >>> >>> > packages/react-reconciler/src/ReactFiberHydrationContext.new.js
458
482
const updatePayload = hydrateInstance(
459
483
instance,
460
484
fiber.type,
@@ -484,7 +508,11 @@ function prepareToHydrateHostTextInstance(fiber: Fiber): boolean {
484
508
485
509
const textInstance: TextInstance = fiber.stateNode;
486
510
const textContent: string = fiber.memoizedProps;
511
+ < << << << packages / react-reconciler / src / ReactFiberHydrationContext . old . js
487
512
const shouldWarnIfMismatchDev = ! didSuspendOrError ;
513
+ === === =
514
+ const shouldWarnIfMismatchDev = ! didSuspendOrErrorDEV ;
515
+ >>> >>> > packages/react-reconciler/src/ReactFiberHydrationContext.new.js
488
516
const shouldUpdate = hydrateTextInstance(
489
517
textInstance,
490
518
textContent,
@@ -663,7 +691,11 @@ function resetHydrationState(): void {
663
691
hydrationParentFiber = null;
664
692
nextHydratableInstance = null;
665
693
isHydrating = false;
694
+ < << << << packages / react-reconciler / src / ReactFiberHydrationContext . old . js
666
695
didSuspendOrError = false ;
696
+ === === =
697
+ didSuspendOrErrorDEV = false ;
698
+ >>> >>> > packages/react-reconciler/src/ReactFiberHydrationContext.new.js
667
699
}
668
700
669
701
export function upgradeHydrationErrorsToRecoverable ( ) : void {
0 commit comments