update query integration
This commit is contained in:
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user