Skip to content

tanstack

Context skill for React apps built on TanStack Start with file-based routing, Router v1, Query v5, Form, and server functions.

Philosophy

The tanstackStart() Vite plugin owns SSR entry generation and produces src/routeTree.gen.ts — that file is never edited by hand and @tanstack/router-plugin is never added separately. The root route is created with createRootRouteWithContext<{ queryClient: QueryClient }>() so loaders and components share a single Query cache. Server-only modules are imported dynamically inside loaders to stay out of the client bundle, and server functions follow a strict chain of .middleware([...]).inputValidator(zod).handler(async (ctx) => ...). The router's defaultPreloadStaleTime is set to 0 so TanStack Query owns all staleness logic.

Recipes

References

Released under the MIT License.