Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: Theo Browne <[email protected]>
24 lines
620 B
TypeScript
24 lines
620 B
TypeScript
import { createRouter, RouterHistory } from "@tanstack/react-router";
|
|
|
|
import { routeTree } from "./routeTree.gen";
|
|
|
|
export function getRouter(history: RouterHistory) {
|
|
return createRouter({
|
|
routeTree,
|
|
history,
|
|
context: {},
|
|
// Route components are split chunks (autoCodeSplitting in vite.config);
|
|
// fetching them on hover/focus intent hides the load from the first
|
|
// settings or pull-request navigation.
|
|
defaultPreload: "intent",
|
|
});
|
|
}
|
|
|
|
export type AppRouter = ReturnType<typeof getRouter>;
|
|
|
|
declare module "@tanstack/react-router" {
|
|
interface Register {
|
|
router: AppRouter;
|
|
}
|
|
}
|