Skip to content

Commit ef231d1

Browse files
committed
Unwrap lazy before reading the value
This is important if the lazy is at the root of the chunk.
1 parent d724ba9 commit ef231d1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/react-client/src/ReactFlightClient.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,8 +1057,7 @@ function getOutlinedModel<T>(
10571057
case INITIALIZED:
10581058
let value = chunk.value;
10591059
for (let i = 1; i < path.length; i++) {
1060-
value = value[path[i]];
1061-
if (value.$$typeof === REACT_LAZY_TYPE) {
1060+
while (value.$$typeof === REACT_LAZY_TYPE) {
10621061
const referencedChunk: SomeChunk<any> = value._payload;
10631062
if (referencedChunk.status === INITIALIZED) {
10641063
value = referencedChunk.value;
@@ -1069,10 +1068,11 @@ function getOutlinedModel<T>(
10691068
key,
10701069
response,
10711070
map,
1072-
path.slice(i),
1071+
path.slice(i - 1),
10731072
);
10741073
}
10751074
}
1075+
value = value[path[i]];
10761076
}
10771077
const chunkValue = map(response, value);
10781078
if (__DEV__ && chunk._debugInfo) {

0 commit comments

Comments
 (0)