refactor(form): migrate from react-hook-form to @tanstack/react-form for improved form handling - #808
Conversation
…rm` for improved form handling
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42f71f74ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| type FormFieldValue = any; |
There was a problem hiding this comment.
Preserve type safety in the public field adapter
Using any here makes every FormFieldApi.value read and onChange write unchecked, so incompatible values passed by custom AutoForm controls can reach schema validation only at runtime instead of being rejected by TypeScript. Make the field API generic over its value type rather than suppressing the lint rule.
AGENTS.md reference: AGENTS.md:L11-L13
Useful? React with 👍 / 👎.
| {Array.from({ length }, (_, index) => ( | ||
| <Field | ||
| className="@md/field-group:items-end" | ||
| key={field.id} | ||
| key={index} | ||
| orientation="responsive" |
There was a problem hiding this comment.
When a non-final row is removed, using its index as the key makes React reuse that row's component subtree for the following value. Stateful controls such as AutoFormNumber retain their old local text state even though TanStack Form has shifted a different row value into that index, so the displayed value can differ from what the form submits until the user edits it; retain stable per-row identifiers as the previous useFieldArray implementation did.
Useful? React with 👍 / 👎.
Improving Documentation
pnpm lint:fixto fix formatting issues before opening the PR.Description
What?
Why?