Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

router.tsx

16 lines480 Bytes

1import { createRouter } from '@tanstack/react-router'
2import { routeTree } from './routeTree.gen'
3import { DefaultCatchBoundary } from './components/DefaultCatchBoundary'
4import { NotFound } from './components/NotFound'
5​
6export function getRouter() {
7 const router = createRouter({
8 routeTree,
9 defaultPreload: 'intent',
10 defaultErrorComponent: DefaultCatchBoundary,
11 defaultNotFoundComponent: () => <NotFound />,
12 scrollRestoration: true,
13 })
14​
15 return router