react/compose-with-tanstack-form

Compose TanStack Table v9 editable cell grids with TanStack Form fields.

28.3k|3.6k|Updated Oct 20, 2016
One-click install
npx skills add https://github.com/TanStack/table --skill react-compose-with-tanstack-form
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react/compose-with-tanstack-form
Source: https://github.com/TanStack/table/tree/main/packages/react-table/skills/react/compose-with-tanstack-form
Command: npx skills add https://github.com/TanStack/table --skill react-compose-with-tanstack-form

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of building truly editable TanStack Table v9 grids by letting TanStack Form own the editing state, validation, and submissions while the table focuses on layout and data operations.

Core Features & Use Cases

  • Editable cell composition: Render row-bound form fields inside each column’s cell, so edits update form-managed values.
  • Validation and submit wiring: Attach Zod (or other validators) at the field and form levels, then handle submit from the form.
  • Row add/remove with correct reactivity: Add or remove rows via form array operations and re-render safely using a subscription to state.values.data.length.
  • Typing safeguards for recursive rows: Avoid TS2589 by using an Omit<Row,'subRows'> pattern for form-bound row types when recursive subRows exist.

Quick Start

Ask an AI to generate a TanStack Table v9 example that composes editable cells using @tanstack/react-form, including add/remove rows, Zod validation, and the Omit<..., 'subRows'> typing fix.

Frequently Asked Questions about react/compose-with-tanstack-form

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

FAQPage Schema
How do I build editable cells in a TanStack Table v9 datagrid?

Editable cells in TanStack Table v9 are built by composing column cell renderers with TanStack Form field components, allowing the form to own editing state and validation while the table manages layout, sorting, and pagination.

Why does my TanStack Form editable grid cause TypeScript deep-key instantiation errors?

TypeScript deep-key instantiation errors occur with recursive row types; you can avoid this by using an Omit<Row, 'subRows'> pattern for form-bound row types when recursive subRows exist in your datagrid structure.

How do I add or remove rows in a TanStack Form editable table without excessive re-renders?

Add or remove rows via form array operations and re-render safely by subscribing to state.values.data.length, which prevents excessive re-renders while maintaining correct datagrid reactivity.

Can I use Zod validation with editable TanStack Table cells?

Yes, Zod validation can be attached at both the field and form levels within editable TanStack Table cells, ensuring per-cell data integrity before handling the form submission.

What's the best way to preserve sorting and filtering when making TanStack Table cells editable?

To preserve sorting and filtering behavior, wire form-owned data directly into the table data prop and use a memoized column definition strategy, letting TanStack Form manage edits without disrupting table operations.