diff --git a/.changeset/orange-insects-complain.md b/.changeset/orange-insects-complain.md new file mode 100644 index 0000000000..048ea8d393 --- /dev/null +++ b/.changeset/orange-insects-complain.md @@ -0,0 +1,5 @@ +--- +"@remix-run/router": patch +--- + +Do not short circuit on hash change only mutation submissions diff --git a/packages/router/__tests__/router-test.ts b/packages/router/__tests__/router-test.ts index 713deed006..58c900369d 100644 --- a/packages/router/__tests__/router-test.ts +++ b/packages/router/__tests__/router-test.ts @@ -819,63 +819,48 @@ const TASK_ROUTES: TestRouteObject[] = [ }, ]; -const TM_ROUTES = [ +const TM_ROUTES: TestRouteObject[] = [ { path: "", id: "root", - - module: "", hasErrorBoundary: true, loader: true, children: [ { path: "/", id: "index", - hasLoader: true, loader: true, action: true, - - module: "", }, { path: "/foo", id: "foo", loader: true, action: true, - - module: "", }, { path: "/foo/bar", id: "foobar", loader: true, action: true, - - module: "", }, { path: "/bar", id: "bar", loader: true, action: true, - - module: "", }, { path: "/baz", id: "baz", loader: true, action: true, - - module: "", }, { path: "/p/:param", id: "param", loader: true, action: true, - - module: "", }, ], }, @@ -1380,7 +1365,7 @@ describe("a router", () => { }); }); - it("does not load anything on hash change only", async () => { + it("does not load anything on hash change only navigations", async () => { let t = initializeTmTest(); expect(t.router.state.loaderData).toMatchObject({ root: "ROOT" }); let A = await t.navigate("/#bar"); @@ -1388,6 +1373,60 @@ describe("a router", () => { expect(t.router.state.loaderData).toMatchObject({ root: "ROOT" }); }); + it('does not load anything on hash change only empty