Skip to content

Commit 7cd5c54

Browse files
authored
Throw single fetch redirects fetched from the server (#12506)
1 parent 64e0a03 commit 7cd5c54

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)