update query integration

This commit is contained in:
yohlo
2025-09-24 08:04:09 -05:00
parent e4164cbc71
commit 6760ea46f9
4 changed files with 31 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
import { QueryClient } from "@tanstack/react-query";
import { createRouter as createTanStackRouter } from "@tanstack/react-router";
import { routerWithQueryClient } from "@tanstack/react-router-with-query";
import { setupRouterSsrQueryIntegration } from "@tanstack/react-router-ssr-query";
import { routeTree } from "./routeTree.gen";
import { DefaultCatchBoundary } from "../components/DefaultCatchBoundary";
import { defaultHeaderConfig } from "@/features/core/hooks/use-router-config";
@@ -18,24 +18,28 @@ export function getRouter() {
},
});
return routerWithQueryClient(
createTanStackRouter({
routeTree,
context: {
queryClient,
auth: undefined!,
header: defaultHeaderConfig,
refresh: [],
withPadding: true,
fullWidth: false,
},
defaultPreload: "intent",
defaultErrorComponent: DefaultCatchBoundary,
scrollRestoration: true,
defaultViewTransition: false,
}),
const router = createTanStackRouter({
routeTree,
context: {
queryClient,
auth: undefined!,
header: defaultHeaderConfig,
refresh: [],
withPadding: true,
fullWidth: false,
},
defaultPreload: "intent",
defaultErrorComponent: DefaultCatchBoundary,
scrollRestoration: true,
defaultViewTransition: false,
});
setupRouterSsrQueryIntegration({
router,
queryClient
);
})
return router;
}
declare module "@tanstack/react-router" {