TanStack / TanStack/form

[v2] Allow nesting of field groups

Open
#2,363 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: runtime scope: core type: enhancement v2
Dominant language
TypeScript
Stars
6.7k
Forks
682
Avg merge
5d 18h
Merged PRs (30d)
7

Description

Describe the bug

In v2, a field group cannot be composed inside another field group.

The parent only exposes fields, but the child requires a form prop. Passing form={fields} causes a TypeScript error. In v1, this worked with form={group}.

Your minimal, reproducible example

N/A - this is a question about the core

Steps to reproduce
  1. Create a child field group with defineFieldGroup.
  2. Render it inside another field group.
  3. Pass the parent fields using form={fields}.
  4. TypeScript reports incompatible types.
Expected behavior

Nested field groups should be composable

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

N/A

TanStack Form adapter

None

TanStack Form version

v2.0.0-alpha.2

TypeScript version

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the v2 core types behind defineFieldGroup, especially how parent fields and the child form prop are typed. Reproduce the nested-group example in a TypeScript check, then confirm that a child field group can accept the parent fields without a type error and that existing field-group behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.