react-start

Implements React bindings and project setup for TanStack Start applications.

1.4k|34|Updated Mar 7, 2024
One-click install
npx skills add https://github.com/mehdibha/dotUI --skill react-start-mehdibha
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-start
Source: https://github.com/mehdibha/dotUI/tree/main/.claude/skills/tanstack-react-start
Command: npx skills add https://github.com/mehdibha/dotUI --skill react-start-mehdibha

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up a TanStack Start application with React involves many moving parts — Vite plugin ordering, router factories, root route documents, server functions, and isomorphic code rules — and small mistakes like importing from the wrong package or omitting the Scripts component break hydration entirely. ## Core Features & Use Cases - Full Project Setup: Step-by-step configuration of package.json, tsconfig, vite.config.ts, router factory, root route, and index route for a working TanStack Start app. - Server Functions with React: Covers createServerFn and the useServerFn hook for calling server logic from components with full type inference. - Common Mistake Prevention: Documents critical pitfalls such as importing createServerFn from @tanstack/react-router instead of @tanstack/react-start, using React hooks in loaders, and missing Scripts components. - Use Case: You are scaffolding a new full-stack React app with TanStack Start and need the correct Vite plugin order, root document structure with HeadContent and Scripts, and a typed server function wired into a route loader. ## Quick Start Set up a new TanStack Start project with React including the Vite config, root route, and a server function example.

Frequently Asked Questions about react-start

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a TanStack Start project with React?▼

Install @tanstack/react-start, @tanstack/react-router, react, and react-dom, then configure vite.config.ts with the tanstackStart plugin placed before the React plugin. Create a router factory, a root route rendering HeadContent and Scripts, and file-based routes.

How do I call server functions from React components in TanStack Start?▼

Define the function with createServerFn from @tanstack/react-start, then wrap it with the useServerFn hook inside your component. The returned function can be awaited in event handlers with typed input data.

What is the difference between @tanstack/react-start and @tanstack/react-router?▼

@tanstack/react-router is the SPA routing library, while @tanstack/react-start is the full-stack framework that re-exports router APIs and adds server functions, middleware, and server utilities. Import createServerFn from react-start, not react-router.

Why is my TanStack Start app not hydrating on the client?▼

Hydration fails when the Scripts component is missing from the root route's body element. Ensure your root document renders HeadContent inside head and Scripts inside body so client JavaScript loads.

Can I use React hooks inside loaders or beforeLoad in TanStack Start?▼

No, loaders and beforeLoad are not React components, so hooks cannot be used there. Pass shared state through router context instead, for example with createRootRouteWithContext.