Skip to content

Commit

Permalink
Throw single fetch redirects fetched from the server
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Dec 9, 2024
1 parent e960efe commit 29cb306
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/unlucky-melons-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Throw unwrapped single fetch redirect to align with pre-single fetch behavior
2 changes: 1 addition & 1 deletion packages/remix-react/single-fetch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ function unwrapSingleFetchResult(result: SingleFetchResult, routeId: string) {
if (result.replace) {
headers["X-Remix-Replace"] = "yes";
}
return redirect(result.redirect, { status: result.status, headers });
throw redirect(result.redirect, { status: result.status, headers });
} else if ("data" in result) {
return result.data;
} else {
Expand Down

0 comments on commit 29cb306

Please sign in to comment.