Skip to content

Commit f854b7a

Browse files
committed
Add router type def modules
1 parent f05f0fb commit f854b7a

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

frontend/src/@types/router.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { router } from './routes';
2+
3+
declare module '@tanstack/react-router' {
4+
interface Register {
5+
router: typeof router;
6+
}
7+
}

frontend/src/routes/index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,3 @@ const notFoundRoute = new Route({
3737
const routeTree = rootRoute.addChildren([indexRoute, cafesRoute, employeesRoute, notFoundRoute]);
3838

3939
export const router = new Router({ routeTree });
40-
41-
declare module '@tanstack/react-router' {
42-
interface Register {
43-
router: typeof router;
44-
}
45-
}

frontend/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
"@/*": ["src/*"]
2626
}
2727
},
28-
"include": ["src", "tsconfig.json"],
28+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/router.d.ts"],
2929
"references": [{ "path": "./tsconfig.node.json" }]
3030
}

0 commit comments

Comments
 (0)