Skip to content

docs: correct withFieldGroup props runtime note#2217

Open
patrickwehbe wants to merge 1 commit into
TanStack:mainfrom
patrickwehbe:docs/fieldgroup-props-runtime
Open

docs: correct withFieldGroup props runtime note#2217
patrickwehbe wants to merge 1 commit into
TanStack:mainfrom
patrickwehbe:docs/fieldgroup-props-runtime

Conversation

@patrickwehbe

@patrickwehbe patrickwehbe commented Jun 20, 2026

Copy link
Copy Markdown

🎯 Changes

The withFieldGroup docs say the props passed to it are "not used at runtime", but they are. In createFormHook the returned render component spreads them into the render call:

return render({ ...props, ...innerProps, group: fieldGroupApi as any })

So props act as default values that the runtime innerProps can override. This is the same thing withForm does (render({ ...props, ...innerProps })), and the withForm docs already describe it correctly as "set as default values for the render function". This just brings the withFieldGroup note in line with that wording across the react, solid and preact guides.

The defaultValues note above it is left as-is, since those really are type-only.

Closes #2099

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Documentation
    • Clarified explanations in form composition guides across Preact, React, and Solid frameworks, improving the documentation for handling default values in field grouping examples.

The withFieldGroup props comment said the props are "not used at
runtime", but they are. In createFormHook the render call spreads them
(render({ ...props, ...innerProps, group })), so they act as default
values that innerProps can override, the same as withForm does with
render({ ...props, ...innerProps }). The withForm docs already describe
this correctly as default values, so this updates the react, solid and
preact copies to match.

Closes TanStack#2099
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a28496ec-b2b3-48f6-9930-f7bb6bc29af6

📥 Commits

Reviewing files that changed from the base of the PR and between 6a73479 and 0ebadda.

📒 Files selected for processing (3)
  • docs/framework/preact/guides/form-composition.md
  • docs/framework/react/guides/form-composition.md
  • docs/framework/solid/guides/form-composition.md

📝 Walkthrough

Walkthrough

A single inline comment in the withFieldGroup example was corrected across three framework documentation files (React, Preact, Solid). The comment now states that the props option sets default values for the render function, replacing the previous (inaccurate) note that those values were only used for type-checking and not at runtime.

Changes

withFieldGroup props comment correction

Layer / File(s) Summary
Comment fix in all framework guides
docs/framework/react/guides/form-composition.md, docs/framework/preact/guides/form-composition.md, docs/framework/solid/guides/form-composition.md
The inline comment for the props option inside the withFieldGroup example is updated in all three files to describe the values as defaults for the render function, replacing the prior wording about type-checking-only usage.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 A comment was wrong, a small fib in the code,
The props were runtime, not just type-checking mode!
Three docs, one fix, a hop and a bound,
The truth of the render at last has been found.
Corrections make docs the best place around! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: correct withFieldGroup props runtime note' accurately summarizes the main change—correcting documentation about how withFieldGroup props are used at runtime.
Description check ✅ Passed The description provides a clear explanation of the change, includes code context, explains the alignment with withForm, and addresses all template sections with adequate detail.
Linked Issues check ✅ Passed The PR directly resolves issue #2099 by updating documentation to reflect that withFieldGroup props are used at runtime as default values, matching the actual code behavior.
Out of Scope Changes check ✅ Passed All changes are documentation updates to three form-composition guides (react, solid, preact), directly addressing the scope of correcting the withFieldGroup props runtime note as outlined in #2099.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

withFieldGroup props used at runtime

1 participant