Open History to see the last commit
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 });
15}
16
17export type AppRouter = ReturnType<typeof getRouter>;
18
19declare module "@tanstack/react-router" {
20 interface Register {
21 router: AppRouter;
22 }
23}