Skip to content

Commit 672a903

Browse files
authored
Fix shouldRevalidate on fetcher action redirect (#9782)
1 parent 159b988 commit 672a903

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.changeset/swift-bottles-cheat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@remix-run/router": patch
3+
---
4+
5+
Fix fetcher shouldRevalidate

packages/router/__tests__/router-test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,15 +2068,10 @@ describe("a router", () => {
20682068
"currentParams": Object {},
20692069
"currentUrl": "http://localhost/",
20702070
"defaultShouldRevalidate": true,
2071-
"formAction": "/fetch",
2072-
"formData": FormData {},
2073-
"formEncType": "application/x-www-form-urlencoded",
2074-
"formMethod": "post",
20752071
"nextParams": Object {},
20762072
"nextUrl": "http://localhost/",
20772073
}
20782074
`);
2079-
expect(Object.fromEntries(arg.formData)).toEqual({ key: "value" });
20802075

20812076
router.dispose();
20822077
});

packages/router/router.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,6 @@ export function createRouter(init: RouterInit): Router {
14161416
updateState({ fetchers: new Map(state.fetchers) });
14171417

14181418
return startRedirectNavigation(state, actionResult, {
1419-
submission,
14201419
isFetchActionRedirect: true,
14211420
});
14221421
}
@@ -1512,7 +1511,7 @@ export function createRouter(init: RouterInit): Router {
15121511

15131512
let redirect = findRedirect(results);
15141513
if (redirect) {
1515-
return startRedirectNavigation(state, redirect, { submission });
1514+
return startRedirectNavigation(state, redirect);
15161515
}
15171516

15181517
// Process and commit output from loaders

0 commit comments

Comments
 (0)