Skip to content

Commit 2fc2cc1

Browse files
committed
Avoid recursion
1 parent bdeaf55 commit 2fc2cc1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/react-client/src/ReactFlightClient.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -625,11 +625,14 @@ function wakeChunkIfInitialized<T>(
625625
}
626626
}
627627
// The status might have changed after fulfilling the reference.
628-
return wakeChunkIfInitialized(
629-
chunk,
630-
resolveListeners,
631-
rejectListeners,
632-
);
628+
switch (chunk.status) {
629+
case INITIALIZED:
630+
wakeChunk(resolveListeners, chunk.value, chunk);
631+
return;
632+
case ERRORED:
633+
rejectChunk(rejectListeners, chunk.reason);
634+
return;
635+
}
633636
}
634637
}
635638
}

0 commit comments

Comments
 (0)