tanstack-form-composition

Migrate React TanStack Form codebases from prop-drilled useForm to the createFormHook composition API.

73|19|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/suxrobGM/jobpilot --skill tanstack-form-composition-suxrobgm
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tanstack-form-composition
Source: https://github.com/suxrobGM/jobpilot/tree/main/.claude/skills/tanstack-form-composition
Command: npx skills add https://github.com/suxrobGM/jobpilot --skill tanstack-form-composition-suxrobgm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @tanstack/react-form.

What problem does it solve? React projects using @tanstack/react-form often accumulate an any-erased form type (like ReactFormExtendedApi<any,...>) threaded through field-wrapper components via form and name props, destroying type safety and hiding real bugs behind casts. This Skill provides a structured four-phase method to migrate such codebases to the official createFormHook composition API, restoring typed field names and values. ## Core Features & Use Cases - Composition infrastructure setup: Creates shared form contexts, bound field components using useFieldContext, a SubmitButton, and the useAppForm/withForm hook wiring. - Call-site migration: Converts useForm to useAppForm, prop-drilled wrappers to form.AppField render props, and shared section components to withForm. - Type-safe cleanup: Deletes the erased form type, replaces form-consuming helpers with minimal structural interfaces, and verifies with typecheck, lint, and formatter. - Use Case: A settings page and onboarding wizard share a PersonalSection component that receives an AnyForm-typed prop. After migration, the section becomes a withForm component with full type inference, and every as unknown as AnyForm cast is removed. ## Quick Start Migrate my React project's TanStack Form code from prop-drilled useForm wrappers to the createFormHook composition API with typed field components.

Frequently Asked Questions about tanstack-form-composition

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

FAQPage Schema
How do I migrate TanStack Form to the createFormHook composition API?▼

Create shared contexts with createFormHookContexts, build bound field components using useFieldContext, wire them through createFormHook to get useAppForm and withForm, then convert each useForm call site to useAppForm and replace prop-drilled wrappers with form.AppField render props.

How to share form sections across multiple TanStack Form forms?▼

Use withForm to wrap the shared section component, passing defaultValues for type inference and receiving the parent's typed form as a prop. This removes the need to thread an erased form type while keeping full type checking across the component boundary.

Does createFormHook work with TanStack Form v0 or older versions?▼

No, createFormHook, createFormHookContexts, and withForm are stable in TanStack Form v1 and later. Check your package.json for @tanstack/react-form version 1+ before starting the migration.

Why do type errors appear after removing the any-erased form type?▼

The erased type was hiding real bugs, commonly number fields whose handleChange receives null or mismatched types. Fix these by widening the bound component's useFieldContext union, such as string | number | null | undefined, rather than re-adding any.

Can I migrate TanStack Form incrementally one form at a time?▼

Yes, the new composition infrastructure coexists with old prop-drilled wrappers, so you can convert one form end-to-end as a reference and keep the project compiling throughout. Migrate a simple form first, then fan out to complex ones.