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

router.tsx

18 lines548 Bytes

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