@@ -227,7 +227,11 @@ function warnNonHydratedInstance(
227
227
}
228
228
}
229
229
230
- function tryHydrateInstance ( fiber : Fiber , nextInstance : any ) {
230
+ function tryHydrateInstance (
231
+ fiber : Fiber ,
232
+ nextInstance : any ,
233
+ hostContext : HostContext ,
234
+ ) {
231
235
// fiber is a HostComponent Fiber
232
236
const instance = canHydrateInstance (
233
237
nextInstance ,
@@ -237,6 +241,22 @@ function tryHydrateInstance(fiber: Fiber, nextInstance: any) {
237
241
) ;
238
242
if ( instance !== null ) {
239
243
fiber . stateNode = ( instance : Instance ) ;
244
+
245
+ if ( __DEV__ ) {
246
+ if ( ! didSuspendOrErrorDEV ) {
247
+ const differences = diffHydratedPropsForDevWarnings (
248
+ instance ,
249
+ fiber . type ,
250
+ fiber . pendingProps ,
251
+ hostContext ,
252
+ ) ;
253
+ if ( differences !== null ) {
254
+ const diffNode = buildHydrationDiffNode ( fiber , 0 ) ;
255
+ diffNode . serverProps = differences ;
256
+ }
257
+ }
258
+ }
259
+
240
260
hydrationParentFiber = fiber ;
241
261
nextHydratableInstance = getFirstHydratableChild ( instance ) ;
242
262
rootOrSingletonContext = false ;
@@ -334,6 +354,22 @@ function claimHydratableSingleton(fiber: Fiber): void {
334
354
currentHostContext ,
335
355
false ,
336
356
) ) ;
357
+
358
+ if ( __DEV__ ) {
359
+ if ( ! didSuspendOrErrorDEV ) {
360
+ const differences = diffHydratedPropsForDevWarnings (
361
+ instance ,
362
+ fiber . type ,
363
+ fiber . pendingProps ,
364
+ currentHostContext ,
365
+ ) ;
366
+ if ( differences !== null ) {
367
+ const diffNode = buildHydrationDiffNode ( fiber , 0 ) ;
368
+ diffNode . serverProps = differences ;
369
+ }
370
+ }
371
+ }
372
+
337
373
hydrationParentFiber = fiber ;
338
374
rootOrSingletonContext = true ;
339
375
nextHydratableInstance = getFirstHydratableChild ( instance ) ;
@@ -354,7 +390,10 @@ function tryToClaimNextHydratableInstance(fiber: Fiber): void {
354
390
) ;
355
391
356
392
const nextInstance = nextHydratableInstance ;
357
- if ( ! nextInstance || ! tryHydrateInstance ( fiber , nextInstance ) ) {
393
+ if (
394
+ ! nextInstance ||
395
+ ! tryHydrateInstance ( fiber , nextInstance , currentHostContext )
396
+ ) {
358
397
if ( shouldKeepWarning ) {
359
398
warnNonHydratedInstance ( fiber , nextInstance ) ;
360
399
}
@@ -433,22 +472,6 @@ function prepareToHydrateHostInstance(
433
472
}
434
473
435
474
const instance : Instance = fiber . stateNode ;
436
- if ( __DEV__ ) {
437
- const shouldWarnIfMismatchDev = ! didSuspendOrErrorDEV ;
438
- if ( shouldWarnIfMismatchDev ) {
439
- const differences = diffHydratedPropsForDevWarnings (
440
- instance ,
441
- fiber . type ,
442
- fiber . memoizedProps ,
443
- hostContext ,
444
- ) ;
445
- if ( differences !== null ) {
446
- const diffNode = buildHydrationDiffNode ( fiber , 0 ) ;
447
- diffNode . serverProps = differences ;
448
- }
449
- }
450
- }
451
-
452
475
const didHydrate = hydrateInstance (
453
476
instance ,
454
477
fiber . type ,
0 commit comments