Skip to content

Commit 9a4d5dd

Browse files
use @tanstack/react-router-ssr-query package for react query integration
1 parent d653efd commit 9a4d5dd

3 files changed

Lines changed: 20 additions & 17 deletions

File tree

bun.lock

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@tailwindcss/vite": "^4.1.13",
4141
"@tanstack/react-query": "^5.90.1",
4242
"@tanstack/react-router": "^1.131.50",
43-
"@tanstack/react-router-with-query": "^1.130.17",
43+
"@tanstack/react-router-ssr-query": "^1.132.6",
4444
"@tanstack/react-start": "^1.131.50",
4545
"class-variance-authority": "^0.7.1",
4646
"clsx": "^2.1.1",

src/router.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import { createRouter as createTanStackRouter } from "@tanstack/react-router";
2-
import { routerWithQueryClient } from "@tanstack/react-router-with-query";
2+
import { setupRouterSsrQueryIntegration } from "@tanstack/react-router-ssr-query";
33
import { QueryClient } from "@tanstack/react-query";
44
import { routeTree } from "./routeTree.gen";
55

66
export function createRouter() {
77
const queryClient = new QueryClient();
88

9-
const router = routerWithQueryClient(
10-
createTanStackRouter({
11-
routeTree,
12-
scrollRestoration: true,
13-
context: {
14-
queryClient,
15-
},
16-
}),
17-
queryClient
18-
);
9+
const router = createTanStackRouter({
10+
routeTree,
11+
scrollRestoration: true,
12+
context: {
13+
queryClient,
14+
},
15+
});
16+
setupRouterSsrQueryIntegration({
17+
router,
18+
queryClient,
19+
});
1920

2021
return router;
2122
}

0 commit comments

Comments
 (0)