docs: correct withFieldGroup props runtime note#2217
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughA single inline comment in the ChangeswithFieldGroup props comment correction
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
🎯 Changes
The
withFieldGroupdocs say thepropspassed to it are "not used at runtime", but they are. IncreateFormHookthe returned render component spreads them into the render call:So
propsact as default values that the runtimeinnerPropscan override. This is the same thingwithFormdoes (render({ ...props, ...innerProps })), and thewithFormdocs already describe it correctly as "set as default values for the render function". This just brings thewithFieldGroupnote in line with that wording across the react, solid and preact guides.The
defaultValuesnote above it is left as-is, since those really are type-only.Closes #2099
✅ Checklist
pnpm test:pr.🚀 Release Impact
Summary by CodeRabbit