Skip to content

Commit

Permalink
Mark boundary as client rendered even if aborting fallback (#21294)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Apr 15, 2021
1 parent f7cdc89 commit cc4b431
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions packages/react-server/src/ReactFizzServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1245,22 +1245,18 @@ function abortTask(task: Task): void {
} else {
boundary.pendingTasks--;

if (boundary.fallbackAbortableTasks.size > 0) {
// If this boundary was still pending then we haven't already cancelled its fallbacks.
// We'll need to abort the fallbacks, which will also error that parent boundary.
// This means that we don't have to client render this boundary because its parent
// will be client rendered anyway.
boundary.fallbackAbortableTasks.forEach(abortTask, request);
boundary.fallbackAbortableTasks.clear();
} else {
if (!boundary.forceClientRender) {
boundary.forceClientRender = true;
if (boundary.parentFlushed) {
request.clientRenderedBoundaries.push(boundary);
}
if (!boundary.forceClientRender) {
boundary.forceClientRender = true;
if (boundary.parentFlushed) {
request.clientRenderedBoundaries.push(boundary);
}
}

// If this boundary was still pending then we haven't already cancelled its fallbacks.
// We'll need to abort the fallbacks, which will also error that parent boundary.
boundary.fallbackAbortableTasks.forEach(abortTask, request);
boundary.fallbackAbortableTasks.clear();

request.allPendingTasks--;
if (request.allPendingTasks === 0) {
const onCompleteAll = request.onCompleteAll;
Expand Down

0 comments on commit cc4b431

Please sign in to comment.