Skip to content

Commit

Permalink
Use resolved value in createModelResolver instead of blocked.value
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable committed Mar 27, 2024
1 parent 36f7400 commit b835af2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/react-client/src/ReactFlightClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk<T>): void {
initializingChunkBlockedModel !== null &&
initializingChunkBlockedModel.deps > 0
) {
initializingChunkBlockedModel.value = value;
// We discovered new dependencies on modules that are not yet resolved.
// We have to go the BLOCKED state until they're resolved.
const blockedChunk: BlockedChunk<T> = (chunk: any);
Expand Down Expand Up @@ -577,10 +576,7 @@ function createModelResolver<T>(
blocked.deps++;
}
} else {
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: (null: any),
};
blocked = initializingChunkBlockedModel = {deps: cyclic ? 0 : 1};
}
return value => {
parentObject[key] = value;
Expand All @@ -592,9 +588,9 @@ function createModelResolver<T>(
const resolveListeners = chunk.value;
const initializedChunk: InitializedChunk<T> = (chunk: any);
initializedChunk.status = INITIALIZED;
initializedChunk.value = blocked.value;
initializedChunk.value = value;
if (resolveListeners !== null) {
wakeChunk(resolveListeners, blocked.value);
wakeChunk(resolveListeners, value);
}
}
};
Expand Down

0 comments on commit b835af2

Please sign in to comment.