Not loaded · from tanstack-start
React bindings for TanStack Start: createStart, StartClient, StartServer, React-specific imports, re-exports from @tanstack/react-router, full project setup with React, useServerFn hook.
Claude Code won't load this skill
It ships in tanstack-start at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
@tanstack/react-start)This skill builds on start-core. Read start-core first for foundational concepts.
This skill covers the React-specific bindings, setup, and patterns for TanStack Start.
For React Server Components patterns, see react-start/server-components.
CRITICAL: All code is ISOMORPHIC by default. Loaders run on BOTH server and client. Use
createServerFnfor server-only logic.
CRITICAL: Do not confuse
@tanstack/react-startwith Next.js or Remix. They are completely different frameworks with different APIs.
CRITICAL: Types are FULLY INFERRED. Never cast, never annotate inferred values.
@tanstack/react-start re-exports everything from @tanstack/start-client-core plus:
useServerFn — React hook for calling server functions from componentsAll core APIs (createServerFn, createMiddleware, createStart, createIsomorphicFn, createServerOnlyFn, createClientOnlyFn) are available from @tanstack/react-start.
Server utilities (getRequest, getRequestHeader, setResponseHeader, setResponseHeaders, setResponseStatus) are imported from @tanstack/react-start/server.
npm i @tanstack/react-start @tanstack/react-router react react-dom
npm i -D vite @vitejs/plugin-react typescript @types/react @types/react-dom
{
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"start": "node .output/server/index.mjs"
}
}
{
"compilerOptions": {
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"module": "ESNext",
"target": "ES2022",
"skipLibCheck": true,
"strictNullChecks": true
}
}
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
export default defineConfig({
plugins: [
tanstackStart(), // MUST come before react()
viteReact(),
],
})
import { createRouter } from '@tanstack/react-router'
import { routeTree } from './routeTree.gen'
export function getRouter() {
const router = createRouter({
routeTree,
scrollRestoration: true,
})
return router
}
import type { ReactNode } from 'react'
import {
Outlet,
createRootRoute,
HeadContent,
Scripts,
} from '@tanstack/react-router'
export const Route = createRootRoute({
head: () => ({
meta: [
{ charSet: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ title: 'My TanStack Start App' },
],
}),
component: RootComponent,
})
function RootComponent() {
return (
<RootDocument>
<Outlet />
</RootDocument>
)
}
function RootDocument({ children }: Readonly<{ children: ReactNode }>) {
return (
<html>
<head>
<HeadContent />
</head>
<body>
{children}
<Scripts />
</body>
</html>
)
}
import { createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
const getGreeting = createServerFn({ method: 'GET' }).handler(async () => {
return 'Hello from TanStack Start!'
})
export const Route = createFileRoute('/')({
loader: () => getGreeting(),
component: HomePage,
})
function HomePage() {
const greeting = Route.useLoaderData()
return <h1>{greeting}</h1>
}
Use useServerFn to call server functions from React components with proper integration:
import { createServerFn, useServerFn } from '@tanstack/react-start'
const updatePost = createServerFn({ method: 'POST' })
.inputValidator((data: { id: string; title: string }) => data)
.handler(async ({ data }) => {
await db.posts.update(data.id, { title: data.title })
return { success: true }
})
function EditPostForm({ postId }: { postId: string }) {
const updatePostFn = useServerFn(updatePost)
const [title, setTitle] = useState('')
return (
<form
onSubmit={async (e) => {
e.preventDefault()
await updatePostFn({ data: { id: postId, title } })
}}
>
<input value={title} onChange={(e) => setTitle(e.target.value)} />
<button type="submit">Save</button>
</form>
)
}
import { createStart, createMiddleware } from '@tanstack/react-start'
const requestLogger = createMiddleware().server(async ({ next, request }) => {
console.log(`${request.method} ${request.url}`)
return next()
})
export const startInstance = createStart(() => ({
requestMiddleware: [requestLogger],
}))
All routing components from @tanstack/react-router work in Start:
<RouterProvider> — not needed in Start (handled automatically)<Outlet> — renders matched child route<Link> — type-safe navigation<Navigate> — declarative redirect<HeadContent> — renders head tags (must be in <head>)<Scripts> — renders body scripts (must be in <body>)<Await> — renders deferred data with Suspense<ClientOnly> — renders children only after hydration<CatchBoundary> — error boundaryAll hooks from @tanstack/react-router work in Start:
useRouter() — router instanceuseRouterState() — subscribe to router stateuseNavigate() — programmatic navigationuseSearch({ from }) — validated search paramsuseParams({ from }) — path paramsuseLoaderData({ from }) — loader datauseMatch({ from }) — full route matchuseRouteContext({ from }) — route contextRoute.useLoaderData() — typed loader data (preferred in route files)Route.useSearch() — typed search params (preferred in route files)// WRONG — this is the SPA router, NOT Start
import { createServerFn } from '@tanstack/react-router'
// CORRECT — server functions come from react-start
import { createServerFn } from '@tanstack/react-start'
// CORRECT — routing APIs come from react-router (re-exported by Start too)
import { createFileRoute, Link } from '@tanstack/react-router'
// WRONG — beforeLoad/loader are NOT React components
beforeLoad: () => {
const auth = useAuth() // React hook, cannot be used here
}
// CORRECT — pass state via router context
const rootRoute = createRootRouteWithContext<{ auth: AuthState }>()({})
Without <Scripts /> in the root route's <body>, client JavaScript doesn't load and the app won't hydrate.
server-components/docs/architecture.md (opens in a new tab)server-components/docs/caching-refresh-ssr.md (opens in a new tab)server-components/docs/composite-components.md (opens in a new tab)server-components/docs/current-api-notes.md (opens in a new tab)server-components/docs/debugging-review.md (opens in a new tab)server-components/docs/sources.md (opens in a new tab)server-components/examples/01-renderable-route-loader.tsx (opens in a new tab)server-components/examples/02-composite-slots.tsx (opens in a new tab)server-components/examples/03-query-owned-rsc.tsx (opens in a new tab)server-components/examples/04-selective-ssr-data-only.tsx (opens in a new tab)server-components/examples/05-ssr-false-browser-loader.tsx (opens in a new tab)server-components/examples/06-low-level-flight-api-route.tsx (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
8 skills in this plugin
/migrate-from-nextjslifecycle/migrate-from-nextjsStep-by-step migration from Next.js App Router to TanStack Start: route definition conversion, API mapping, server function conversion from Server Actions, middleware conversion, data fetching pattern changes./router-coreFramework-agnostic core concepts for TanStack Router: route trees, createRouter, createRoute, createRootRoute, createRootRouteWithContext, addChildren, Register type declaration, route matching, route sorting, file naming conventions. Entry point for all router skills./router-pluginTanStack Router bundler plugin for route generation and automatic code splitting. Supports Vite, Webpack, Rspack, and esbuild. Configures autoCodeSplitting, routesDirectory, target framework, and code split groupings./start-coreCore overview for TanStack Start: tanstackStart() Vite plugin, getRouter() factory, root route document shell (HeadContent, Scripts, Outlet), client/server entry points, routeTree.gen.ts, tsconfig configuration. Entry point for all Start skills./start-server-coreServer-side runtime for TanStack Start: createStartHandler, request/response utilities (getRequest, setResponseHeader, setCookie, getCookie, useSession), three-phase request handling, AsyncLocalStorage context./tanstack-start-guideMUST load BEFORE writing, scaffolding, debugging, or migrating any TanStack Start / Router / React Start app, and BEFORE hand-rolling routing, loaders, server functions, server routes, middleware, SSR, or RSC. Trigger on ANY of: "TanStack Start/Router", "React Start", "@tanstack/start", "@tanstack/react-start", "@tanstack/react-router", "createFileRoute", "createRootRoute", "createServerFn", "createServerRoute", "start-basic", "file-based routes", "virtual file routes", "authenticated route", "route guard/loader", "deferred data", "useLoaderData/useSearch/useParams/useNavigate", "search params validation", "navigation blocking", "view transitions", "location masking", "tRPC/React Query with TanStack", "SSR/RSC in Start", "not-found route", "migrate Next.js to TanStack", "deploy TanStack Start". Also applies when the codebase has `app/routes/` with `createFileRoute` or `@tanstack/*` imports, even if "TanStack" isn't named. Does NOT cover generic React or visual design — pair with frontend-design / shadcn-ui.
npx claudepluginhub lespaceman/athena-workflow-marketplace --plugin tanstack-start