Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

router.ts

23 lines620 Bytes

1import { createRouter, RouterHistory } from "@tanstack/react-router";
2​
3import { routeTree } from "./routeTree.gen";
4​
5export function getRouter(history: RouterHistory) {
6 return createRouter({
7 routeTree,
8 history,
9 context: {},
10 // Route components are split chunks (autoCodeSplitting in vite.config);
11 // fetching them on hover/focus intent hides the load from the first
12 // settings or pull-request navigation.
13 defaultPreload: "intent",
14 });
16​
17export type AppRouter = ReturnType<typeof getRouter>;
18​
19declare module "@tanstack/react-router" {
20 interface Register {
21 router: AppRouter;
22 }