Skip to content

Commit

Permalink
Fix shouldRevalidate on fetcher action redirect (#9782)
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 authored Dec 22, 2022
1 parent 159b988 commit 672a903
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-bottles-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/router": patch
---

Fix fetcher shouldRevalidate
5 changes: 0 additions & 5 deletions packages/router/__tests__/router-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2068,15 +2068,10 @@ describe("a router", () => {
"currentParams": Object {},
"currentUrl": "http://localhost/",
"defaultShouldRevalidate": true,
"formAction": "/fetch",
"formData": FormData {},
"formEncType": "application/x-www-form-urlencoded",
"formMethod": "post",
"nextParams": Object {},
"nextUrl": "http://localhost/",
}
`);
expect(Object.fromEntries(arg.formData)).toEqual({ key: "value" });

router.dispose();
});
Expand Down
3 changes: 1 addition & 2 deletions packages/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,6 @@ export function createRouter(init: RouterInit): Router {
updateState({ fetchers: new Map(state.fetchers) });

return startRedirectNavigation(state, actionResult, {
submission,
isFetchActionRedirect: true,
});
}
Expand Down Expand Up @@ -1512,7 +1511,7 @@ export function createRouter(init: RouterInit): Router {

let redirect = findRedirect(results);
if (redirect) {
return startRedirectNavigation(state, redirect, { submission });
return startRedirectNavigation(state, redirect);
}

// Process and commit output from loaders
Expand Down

0 comments on commit 672a903

Please sign in to comment.