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

router.tsx

17 lines504 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 basepath: '/test/',
10 defaultPreload: 'intent',
11 defaultErrorComponent: DefaultCatchBoundary,
12 defaultNotFoundComponent: () => <NotFound />,
13 scrollRestoration: true,
14 })
15​
16 return router