@@ -1172,7 +1172,7 @@ function createElement(
11721172 props : mixed ,
11731173 owner : ?ReactComponentInfo , // DEV-only
11741174 stack : ?ReactStackTrace , // DEV-only
1175- validated : number , // DEV-only
1175+ validated : 0 | 1 | 2 , // DEV-only
11761176) :
11771177 | React$Element < any >
11781178 | LazyComponent < React$Element < any > , SomeChunk < React$Element < any >>> {
@@ -1268,7 +1268,7 @@ function createElement(
12681268 }
12691269 erroredChunk . _debugInfo = [ erroredComponent ] ;
12701270 }
1271- return createLazyChunkWrapper(erroredChunk);
1271+ return createLazyChunkWrapper(erroredChunk, validated );
12721272 }
12731273 if ( handler . deps > 0 ) {
12741274 // We have blocked references inside this Element but we can turn this into
@@ -1277,7 +1277,7 @@ function createElement(
12771277 createBlockedChunk ( response ) ;
12781278 handler . value = element ;
12791279 handler . chunk = blockedChunk ;
1280- const lazyType = createLazyChunkWrapper ( blockedChunk ) ;
1280+ const lazyType = createLazyChunkWrapper ( blockedChunk , validated ) ;
12811281 if ( __DEV__ ) {
12821282 // After we have initialized any blocked references, initialize stack etc.
12831283 const init = initializeElement . bind ( null , response , element , lazyType ) ;
@@ -1295,18 +1295,20 @@ function createElement(
12951295
12961296function createLazyChunkWrapper < T > (
12971297 chunk: SomeChunk< T > ,
1298+ validated: 0 | 1 | 2, // DEV-only
12981299): LazyComponent< T , SomeChunk < T > > {
12991300 const lazyType : LazyComponent < T , SomeChunk < T >> = {
13001301 $$typeof : REACT_LAZY_TYPE ,
13011302 _payload : chunk ,
1302- _store : { validated : 0 } ,
13031303 _init : readChunk ,
13041304 } ;
13051305 if ( __DEV__ ) {
13061306 // Ensure we have a live array to track future debug info.
13071307 const chunkDebugInfo : ReactDebugInfo =
13081308 chunk . _debugInfo || ( chunk . _debugInfo = ( [ ] : ReactDebugInfo ) ) ;
13091309 lazyType . _debugInfo = chunkDebugInfo ;
1310+ // Initialize a store for key validation by the JSX runtime.
1311+ lazyType . _store = { validated : validated } ;
13101312 }
13111313 return lazyType ;
13121314}
@@ -2111,7 +2113,7 @@ function parseModelString(
21112113 }
21122114 // We create a React.lazy wrapper around any lazy values.
21132115 // When passed into React, we'll know how to suspend on this.
2114- return createLazyChunkWrapper ( chunk ) ;
2116+ return createLazyChunkWrapper ( chunk , 0 ) ;
21152117 }
21162118 case '@': {
21172119 // Promise
0 commit comments