Skip to content

Commit b92314f

Browse files
committed
Throw single fetch redirects fetched from the server
1 parent 64e0a03 commit b92314f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/dry-toes-sneeze.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Throw unwrapped single fetch redirect to align with pre-single fetch behavior

packages/react-router/lib/dom/ssr/single-fetch.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ function unwrapSingleFetchResult(result: SingleFetchResult, routeId: string) {
522522
if (result.replace) {
523523
headers["X-Remix-Replace"] = "yes";
524524
}
525-
return redirect(result.redirect, { status: result.status, headers });
525+
throw redirect(result.redirect, { status: result.status, headers });
526526
} else if ("data" in result) {
527527
return result.data;
528528
} else {

0 commit comments

Comments
 (0)