@@ -1172,7 +1172,7 @@ function createElement(
1172
1172
props : mixed ,
1173
1173
owner : ?ReactComponentInfo , // DEV-only
1174
1174
stack : ?ReactStackTrace , // DEV-only
1175
- validated : number , // DEV-only
1175
+ validated : 0 | 1 | 2 , // DEV-only
1176
1176
) :
1177
1177
| React$Element < any >
1178
1178
| LazyComponent < React$Element < any > , SomeChunk < React$Element < any >>> {
@@ -1268,7 +1268,7 @@ function createElement(
1268
1268
}
1269
1269
erroredChunk . _debugInfo = [ erroredComponent ] ;
1270
1270
}
1271
- return createLazyChunkWrapper(erroredChunk);
1271
+ return createLazyChunkWrapper(erroredChunk, validated );
1272
1272
}
1273
1273
if ( handler . deps > 0 ) {
1274
1274
// We have blocked references inside this Element but we can turn this into
@@ -1277,7 +1277,7 @@ function createElement(
1277
1277
createBlockedChunk ( response ) ;
1278
1278
handler . value = element ;
1279
1279
handler . chunk = blockedChunk ;
1280
- const lazyType = createLazyChunkWrapper ( blockedChunk ) ;
1280
+ const lazyType = createLazyChunkWrapper ( blockedChunk , validated ) ;
1281
1281
if ( __DEV__ ) {
1282
1282
// After we have initialized any blocked references, initialize stack etc.
1283
1283
const init = initializeElement . bind ( null , response , element , lazyType ) ;
@@ -1295,18 +1295,20 @@ function createElement(
1295
1295
1296
1296
function createLazyChunkWrapper < T > (
1297
1297
chunk: SomeChunk< T > ,
1298
+ validated: 0 | 1 | 2, // DEV-only
1298
1299
): LazyComponent< T , SomeChunk < T > > {
1299
1300
const lazyType : LazyComponent < T , SomeChunk < T >> = {
1300
1301
$$typeof : REACT_LAZY_TYPE ,
1301
1302
_payload : chunk ,
1302
- _store : { validated : 0 } ,
1303
1303
_init : readChunk ,
1304
1304
} ;
1305
1305
if ( __DEV__ ) {
1306
1306
// Ensure we have a live array to track future debug info.
1307
1307
const chunkDebugInfo : ReactDebugInfo =
1308
1308
chunk . _debugInfo || ( chunk . _debugInfo = ( [ ] : ReactDebugInfo ) ) ;
1309
1309
lazyType . _debugInfo = chunkDebugInfo ;
1310
+ // Initialize a store for key validation by the JSX runtime.
1311
+ lazyType . _store = { validated : validated } ;
1310
1312
}
1311
1313
return lazyType ;
1312
1314
}
@@ -2111,7 +2113,7 @@ function parseModelString(
2111
2113
}
2112
2114
// We create a React.lazy wrapper around any lazy values.
2113
2115
// When passed into React, we'll know how to suspend on this.
2114
- return createLazyChunkWrapper ( chunk ) ;
2116
+ return createLazyChunkWrapper ( chunk , 0 ) ;
2115
2117
}
2116
2118
case '@': {
2117
2119
// Promise
0 commit comments