@@ -23,10 +23,7 @@ import {
23
23
} from 'shared/ReactSymbols' ;
24
24
import { ClassComponent , HostText , HostPortal , Fragment } from './ReactWorkTags' ;
25
25
import isArray from 'shared/isArray' ;
26
- import {
27
- warnAboutStringRefs ,
28
- enableLazyElements ,
29
- } from 'shared/ReactFeatureFlags' ;
26
+ import { warnAboutStringRefs } from 'shared/ReactFeatureFlags' ;
30
27
import { checkPropStringCoercion } from 'shared/CheckStringCoercion' ;
31
28
32
29
import {
@@ -414,8 +411,7 @@ function ChildReconciler(shouldTrackSideEffects) {
414
411
// We need to do this after the Hot Reloading check above,
415
412
// because hot reloading has different semantics than prod because
416
413
// it doesn't resuspend. So we can't let the call below suspend.
417
- ( enableLazyElements &&
418
- typeof elementType === 'object' &&
414
+ ( typeof elementType === 'object' &&
419
415
elementType !== null &&
420
416
elementType . $$typeof === REACT_LAZY_TYPE &&
421
417
resolveLazy ( elementType ) === current . type )
@@ -530,11 +526,9 @@ function ChildReconciler(shouldTrackSideEffects) {
530
526
return created ;
531
527
}
532
528
case REACT_LAZY_TYPE : {
533
- if ( enableLazyElements ) {
534
- const payload = newChild . _payload ;
535
- const init = newChild . _init ;
536
- return createChild ( returnFiber , init ( payload ) , lanes ) ;
537
- }
529
+ const payload = newChild . _payload ;
530
+ const init = newChild . _init ;
531
+ return createChild ( returnFiber , init ( payload ) , lanes ) ;
538
532
}
539
533
}
540
534
@@ -601,11 +595,9 @@ function ChildReconciler(shouldTrackSideEffects) {
601
595
}
602
596
}
603
597
case REACT_LAZY_TYPE : {
604
- if ( enableLazyElements ) {
605
- const payload = newChild . _payload ;
606
- const init = newChild . _init ;
607
- return updateSlot ( returnFiber , oldFiber , init ( payload ) , lanes ) ;
608
- }
598
+ const payload = newChild . _payload ;
599
+ const init = newChild . _init ;
600
+ return updateSlot ( returnFiber , oldFiber , init ( payload ) , lanes ) ;
609
601
}
610
602
}
611
603
@@ -663,17 +655,15 @@ function ChildReconciler(shouldTrackSideEffects) {
663
655
return updatePortal ( returnFiber , matchedFiber , newChild , lanes ) ;
664
656
}
665
657
case REACT_LAZY_TYPE :
666
- if ( enableLazyElements ) {
667
- const payload = newChild . _payload ;
668
- const init = newChild . _init ;
669
- return updateFromMap (
670
- existingChildren ,
671
- returnFiber ,
672
- newIdx ,
673
- init ( payload ) ,
674
- lanes ,
675
- ) ;
676
- }
658
+ const payload = newChild . _payload ;
659
+ const init = newChild . _init ;
660
+ return updateFromMap (
661
+ existingChildren ,
662
+ returnFiber ,
663
+ newIdx ,
664
+ init ( payload ) ,
665
+ lanes ,
666
+ ) ;
677
667
}
678
668
679
669
if ( isArray ( newChild ) || getIteratorFn ( newChild ) ) {
@@ -732,14 +722,10 @@ function ChildReconciler(shouldTrackSideEffects) {
732
722
) ;
733
723
break ;
734
724
case REACT_LAZY_TYPE :
735
- if ( enableLazyElements ) {
736
- const payload = child . _payload ;
737
- const init = ( child . _init : any ) ;
738
- warnOnInvalidKey ( init ( payload ) , knownKeys , returnFiber ) ;
739
- break ;
740
- }
741
- // We intentionally fallthrough here if enableLazyElements is not on.
742
- // eslint-disable-next-lined no-fallthrough
725
+ const payload = child . _payload ;
726
+ const init = ( child . _init : any ) ;
727
+ warnOnInvalidKey ( init ( payload ) , knownKeys , returnFiber ) ;
728
+ break ;
743
729
default:
744
730
break ;
745
731
}
@@ -1175,8 +1161,7 @@ function ChildReconciler(shouldTrackSideEffects) {
1175
1161
// We need to do this after the Hot Reloading check above,
1176
1162
// because hot reloading has different semantics than prod because
1177
1163
// it doesn't resuspend. So we can't let the call below suspend.
1178
- ( enableLazyElements &&
1179
- typeof elementType === 'object' &&
1164
+ ( typeof elementType === 'object' &&
1180
1165
elementType !== null &&
1181
1166
elementType . $$typeof === REACT_LAZY_TYPE &&
1182
1167
resolveLazy ( elementType ) === child . type )
@@ -1302,17 +1287,15 @@ function ChildReconciler(shouldTrackSideEffects) {
1302
1287
) ,
1303
1288
) ;
1304
1289
case REACT_LAZY_TYPE :
1305
- if ( enableLazyElements ) {
1306
- const payload = newChild . _payload ;
1307
- const init = newChild . _init ;
1308
- // TODO: This function is supposed to be non-recursive.
1309
- return reconcileChildFibers (
1310
- returnFiber ,
1311
- currentFirstChild ,
1312
- init ( payload ) ,
1313
- lanes ,
1314
- ) ;
1315
- }
1290
+ const payload = newChild . _payload ;
1291
+ const init = newChild . _init ;
1292
+ // TODO: This function is supposed to be non-recursive.
1293
+ return reconcileChildFibers (
1294
+ returnFiber ,
1295
+ currentFirstChild ,
1296
+ init ( payload ) ,
1297
+ lanes ,
1298
+ ) ;
1316
1299
}
1317
1300
1318
1301
if ( isArray ( newChild ) ) {
0 commit comments