Mark boundary as client rendered even if aborting fallback (#21294)
Sebastian Markbåge committed
Apr 15, 2021 at 19:16 UTC
cc4b431dab2a9ee296212d698a6034f5fe4ac8c8
1 file changed
+9
-13
packages/react-server/src/ReactFizzServer.js
+9
-13
@@ -1245,22 +1245,18 @@ function abortTask(task: Task): void {
1245
} else {
1246
boundary.pendingTasks--;
1247
1248
- if (boundary.fallbackAbortableTasks.size > 0) {
1249
- // If this boundary was still pending then we haven't already cancelled its fallbacks.
1250
- // We'll need to abort the fallbacks, which will also error that parent boundary.
1251
- // This means that we don't have to client render this boundary because its parent
1252
- // will be client rendered anyway.
1253
- boundary.fallbackAbortableTasks.forEach(abortTask, request);
1254
- boundary.fallbackAbortableTasks.clear();
1255
- } else {
1256
- if (!boundary.forceClientRender) {
1257
- boundary.forceClientRender = true;
1258
- if (boundary.parentFlushed) {
1259
- request.clientRenderedBoundaries.push(boundary);
1260
- }
1248
+ if (!boundary.forceClientRender) {
1249
+ boundary.forceClientRender = true;
1250
+ if (boundary.parentFlushed) {
1251
+ request.clientRenderedBoundaries.push(boundary);
1252
}
1253
}
1254
1255
+ // If this boundary was still pending then we haven't already cancelled its fallbacks.
1256
+ // We'll need to abort the fallbacks, which will also error that parent boundary.
1257
+ boundary.fallbackAbortableTasks.forEach(abortTask, request);
1258
+ boundary.fallbackAbortableTasks.clear();
1259
+
1260
request.allPendingTasks--;
1261
if (request.allPendingTasks === 0) {
1262
const onCompleteAll = request.onCompleteAll;