Skip to content

refactor(form): migrate from react-hook-form to @tanstack/react-form for improved form handling - #808

Merged
aXenDeveloper merged 2 commits into
canaryfrom
refactor/tanstack_form
Sep 14, 2026
Merged

aXenDeveloper merged 2 commits into
canaryfrom
refactor/tanstack_form

Conversation

@aXenDeveloper

Copy link
Copy Markdown
Owner

Improving Documentation

Description

What?

Why?

@vercel

vercel Bot commented Sep 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vitnode-prod Error Error Sep 13, 2026 6:35pm UTC

@github-actions github-actions Bot added the 🧱 Refactor A code change that neither fixes a bug nor adds a feature label Sep 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +80 to 84
{Array.from({ length }, (_, index) => (
<Field
className="@md/field-group:items-end"
key={field.id}
key={index}
orientation="responsive"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Give array rows stable keys

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 👍 / 👎.

@aXenDeveloper
aXenDeveloper added this pull request to stack #810 September 13, 2026 20:05
@aXenDeveloper
aXenDeveloper merged commit f5d0b24 into canary Sep 14, 2026
4 of 5 checks passed
@aXenDeveloper
aXenDeveloper deleted the refactor/tanstack_form branch September 14, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧱 Refactor A code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant