tanstack-router
Installation
SKILL.md
TanStack Router
Use this skill to apply current, source-backed TanStack guidance. Keep answers aligned with installed package source first, official TanStack docs second, and package-shipped skills third. Read references/current-authority.md when APIs, versions, CLI commands, or source freshness materially affect the task.
Decision Tree
- Need a new route? Use file-based routing and let the plugin/CLI generate
routeTree.gen.ts. - Need shared dependencies? Type them in
createRootRouteWithContext<T>()and pass them tocreateRouter({ context }). - Need URL state? Validate with
validateSearchand useloaderDepsfor cache keys. - Need route data? Use loaders; use TanStack Query only when Query owns server-state cache.
- Need route splitting? Prefer router plugin
autoCodeSplitting: true; use.lazy.tsxas fallback.