How to get type infer?
I build a electron project use forge.And build route by docs's quick start.But cannot get type infer.
The code is same as docs show.
It may be tsconfig.json? here is tsconfig.json


6 Replies
xenial-black•2y ago
Have you registered the router using the declare module? This is what powers the type completion.
https://tanstack.com/router/latest/docs/framework/react/quick-start#srcapptsx
Quick Start | TanStack Router Docs
If you're feeling impatient and prefer to skip all of our wonderful documentation, here is the bare minimum to get going with TanStack Router using both file-based route generation and code-based route configuration:
Using File-Based Route Generation + Vite
optimistic-goldOP•2y ago
of course,I flow quick star step by step.and also generate gen.ts successfully
xenial-black•2y ago
If you've declared the router on the module, then its either your tsconfig/typescript set up or the way your editor is picking up the ts-types.
optimistic-goldOP•2y ago
yep of course,all of code is same as quickly start

optimistic-goldOP•2y ago
i think it maybe tsconfig lead to it
xenial-black•2y ago
Probably.
A couple days back someone was using it in a monorepo with Webstorm, and for whatever reason the IDE's implementation of the typescript language server only recognized the root tsconfig and not the app-level one.