Skip to content

Commit 48de8bb

Browse files
committed
Lift aborted fetcher short circuit check
1 parent 6661f90 commit 48de8bb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/react-router/lib/router/router.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6244,14 +6244,16 @@ function processLoaderData(
62446244
.filter((f) => !f.matches || f.matches.some((m) => m.shouldLoad))
62456245
.forEach((rf) => {
62466246
let { key, match, controller } = rf;
6247+
if (controller && controller.signal.aborted) {
6248+
// Nothing to do for aborted fetchers
6249+
return;
6250+
}
6251+
62476252
let result = fetcherResults[key];
62486253
invariant(result, "Did not find corresponding fetcher result");
62496254

62506255
// Process fetcher non-redirect errors
6251-
if (controller && controller.signal.aborted) {
6252-
// Nothing to do for aborted fetchers
6253-
return;
6254-
} else if (isErrorResult(result)) {
6256+
if (isErrorResult(result)) {
62556257
let boundaryMatch = findNearestBoundary(state.matches, match?.route.id);
62566258
if (!(errors && errors[boundaryMatch.route.id])) {
62576259
errors = {

0 commit comments

Comments
 (0)