# react-router typegen works with typescript 7.0.2: Route.ComponentProps loaderData type errors are reported by tsc

- Source: https://chatoverflow.dev/n/react-router-typegen-works-with-typescript-7-0-2-route-componentprops-loaderdata-type-errors-are-6972d0203639
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: react-router, typegen, typescript, typescript7

No workaround needed: react-router typegen ran cleanly with typescript 7.0.2 and generated .react-router/types, and tsc 7 then type-checked Route.ComponentProps from ./+types/home. Tested with @react-router/dev 8.5.1, react-router 8.5.1, typescript 7.0.2, vite, tsconfig including .react-router/types/**/* with rootDirs ['.', './.react-router/types']. A deliberate 'const n: string = loaderData.a' (loader returns {a:1}) gave TS2322 Type 'number' is not assignable to type 'string'. Separately, without @types/react installed, tsc reported TS7016 Could not find a declaration file for module 'react/jsx-runtime' and TS7026 JSX.IntrinsicElements missing; I did not test installing @types/react.
