@@ -220,7 +220,11 @@ function warnNonHydratedInstance(
220
220
}
221
221
}
222
222
223
- function tryHydrateInstance ( fiber : Fiber , nextInstance : any ) {
223
+ function tryHydrateInstance (
224
+ fiber : Fiber ,
225
+ nextInstance : any ,
226
+ hostContext : HostContext ,
227
+ ) {
224
228
// fiber is a HostComponent Fiber
225
229
const instance = canHydrateInstance (
226
230
nextInstance ,
@@ -230,6 +234,22 @@ function tryHydrateInstance(fiber: Fiber, nextInstance: any) {
230
234
) ;
231
235
if ( instance !== null ) {
232
236
fiber . stateNode = ( instance : Instance ) ;
237
+
238
+ if ( __DEV__ ) {
239
+ if ( ! didSuspendOrErrorDEV ) {
240
+ const differences = diffHydratedPropsForDevWarnings (
241
+ instance ,
242
+ fiber . type ,
243
+ fiber . pendingProps ,
244
+ hostContext ,
245
+ ) ;
246
+ if ( differences !== null ) {
247
+ const diffNode = buildHydrationDiffNode ( fiber , 0 ) ;
248
+ diffNode . serverProps = differences ;
249
+ }
250
+ }
251
+ }
252
+
233
253
hydrationParentFiber = fiber ;
234
254
nextHydratableInstance = getFirstHydratableChild ( instance ) ;
235
255
rootOrSingletonContext = false ;
@@ -327,6 +347,22 @@ function claimHydratableSingleton(fiber: Fiber): void {
327
347
currentHostContext ,
328
348
false ,
329
349
) ) ;
350
+
351
+ if ( __DEV__ ) {
352
+ if ( ! didSuspendOrErrorDEV ) {
353
+ const differences = diffHydratedPropsForDevWarnings (
354
+ instance ,
355
+ fiber . type ,
356
+ fiber . pendingProps ,
357
+ currentHostContext ,
358
+ ) ;
359
+ if ( differences !== null ) {
360
+ const diffNode = buildHydrationDiffNode ( fiber , 0 ) ;
361
+ diffNode . serverProps = differences ;
362
+ }
363
+ }
364
+ }
365
+
330
366
hydrationParentFiber = fiber ;
331
367
rootOrSingletonContext = true ;
332
368
nextHydratableInstance = getFirstHydratableChild ( instance ) ;
@@ -347,7 +383,10 @@ function tryToClaimNextHydratableInstance(fiber: Fiber): void {
347
383
) ;
348
384
349
385
const nextInstance = nextHydratableInstance ;
350
- if ( ! nextInstance || ! tryHydrateInstance ( fiber , nextInstance ) ) {
386
+ if (
387
+ ! nextInstance ||
388
+ ! tryHydrateInstance ( fiber , nextInstance , currentHostContext )
389
+ ) {
351
390
if ( shouldKeepWarning ) {
352
391
warnNonHydratedInstance ( fiber , nextInstance ) ;
353
392
}
@@ -426,22 +465,6 @@ function prepareToHydrateHostInstance(
426
465
}
427
466
428
467
const instance : Instance = fiber . stateNode ;
429
- if ( __DEV__ ) {
430
- const shouldWarnIfMismatchDev = ! didSuspendOrErrorDEV ;
431
- if ( shouldWarnIfMismatchDev ) {
432
- const differences = diffHydratedPropsForDevWarnings (
433
- instance ,
434
- fiber . type ,
435
- fiber . memoizedProps ,
436
- hostContext ,
437
- ) ;
438
- if ( differences !== null ) {
439
- const diffNode = buildHydrationDiffNode ( fiber , 0 ) ;
440
- diffNode . serverProps = differences ;
441
- }
442
- }
443
- }
444
-
445
468
const didHydrate = hydrateInstance (
446
469
instance ,
447
470
fiber . type ,
0 commit comments