MCPcopy Create free account
hub / github.com/TanStack/router / getRouter

Function getRouter

examples/react/start-basic-react-query/src/router.tsx:8–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6import { NotFound } from './components/NotFound'
7
8export function getRouter() {
9 const queryClient = new QueryClient({
10 defaultOptions: { queries: { staleTime: 30_000 } },
11 })
12
13 const router = createRouter({
14 routeTree,
15 context: { queryClient },
16 defaultPreload: 'intent',
17 defaultPreloadStaleTime: 0,
18 defaultErrorComponent: DefaultCatchBoundary,
19 defaultNotFoundComponent: () => <NotFound />,
20 })
21 setupRouterSsrQueryIntegration({
22 router,
23 queryClient,
24 })
25
26 return router
27}
28
29declare module '@tanstack/react-router' {
30 interface Register {

Callers

nothing calls this directly

Calls 2

createRouterFunction · 0.90

Tested by

no test coverage detected