Skip to content

Commit

Permalink
We need to check if it's uninitialized for sync resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Jun 7, 2021
1 parent c490caf commit cc42e7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/ReactLazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ function lazyInitializer<T>(payload: Payload<T>): T {
// end up fixing it if the resolution was a concurrency bug.
thenable.then(
moduleObject => {
if (payload._status === Pending) {
if (payload._status === Pending || payload._status === Uninitialized) {
// Transition to the next state.
const resolved: ResolvedPayload<T> = (payload: any);
resolved._status = Resolved;
resolved._result = moduleObject;
}
},
error => {
if (payload._status === Pending) {
if (payload._status === Pending || payload._status === Uninitialized) {
// Transition to the next state.
const rejected: RejectedPayload = (payload: any);
rejected._status = Rejected;
Expand Down

0 comments on commit cc42e7b

Please sign in to comment.