Skip to content

Commit d216bca

Browse files
authored
Throw single fetch redirects fetched from the server (#10317)
1 parent e960efe commit d216bca

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/unlucky-melons-promise.md

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

packages/remix-react/single-fetch.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ function unwrapSingleFetchResult(result: SingleFetchResult, routeId: string) {
491491
if (result.replace) {
492492
headers["X-Remix-Replace"] = "yes";
493493
}
494-
return redirect(result.redirect, { status: result.status, headers });
494+
throw redirect(result.redirect, { status: result.status, headers });
495495
} else if ("data" in result) {
496496
return result.data;
497497
} else {

0 commit comments

Comments
 (0)