Skip to content

Commit cc42e7b

Browse files
committed
We need to check if it's uninitialized for sync resolution
1 parent c490caf commit cc42e7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react/src/ReactLazy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ function lazyInitializer<T>(payload: Payload<T>): T {
5959
// end up fixing it if the resolution was a concurrency bug.
6060
thenable.then(
6161
moduleObject => {
62-
if (payload._status === Pending) {
62+
if (payload._status === Pending || payload._status === Uninitialized) {
6363
// Transition to the next state.
6464
const resolved: ResolvedPayload<T> = (payload: any);
6565
resolved._status = Resolved;
6666
resolved._result = moduleObject;
6767
}
6868
},
6969
error => {
70-
if (payload._status === Pending) {
70+
if (payload._status === Pending || payload._status === Uninitialized) {
7171
// Transition to the next state.
7272
const rejected: RejectedPayload = (payload: any);
7373
rejected._status = Rejected;

0 commit comments

Comments
 (0)