Skip to content

Conversation

@ws-rush
Copy link

@ws-rush ws-rush commented Jan 6, 2026

Fixes issue #1980 where custom field meta properties were not triggering updates in useField.
Replaced granular meta subscriptions with a full state.meta subscription in useField hook.
Optimized FormApi.setFieldValue in @tanstack/form-core to avoid unnecessary meta updates, preserving performance optimizations for array fields.
Added regression test and updated existing tests.


PR created automatically by Jules for task 18083788771914964547 started by @ws-rush

… custom meta properties

This commit modifies `useField` to subscribe to the entire `state.meta` object instead of granular properties. This ensures that custom meta properties (like `hidden`) added by users trigger re-renders when updated.

To mitigate performance regressions (specifically array fields re-rendering on every child update due to `isDirty`/`isTouched` refresh), `FormApi.setFieldValue` is optimized to skip `setFieldMeta` if the meta state is already correct. This ensures `meta` object reference stability when relevant state hasn't changed.

Added regression test `tests/issue-1980.test.tsx`.
Updated `tests/useField.test.tsx` to accommodate the slight behavior change (initial re-render due to `isDefaultValue` change).
@changeset-bot
Copy link

changeset-bot bot commented Jan 6, 2026

🦋 Changeset detected

Latest commit: b3774a2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@tanstack/react-form Patch
@tanstack/form-core Patch
@tanstack/react-form-nextjs Patch
@tanstack/react-form-remix Patch
@tanstack/react-form-start Patch
@tanstack/angular-form Patch
@tanstack/form-devtools Patch
@tanstack/lit-form Patch
@tanstack/solid-form Patch
@tanstack/svelte-form Patch
@tanstack/vue-form Patch
@tanstack/react-form-devtools Patch
@tanstack/solid-form-devtools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

ws-rush and others added 2 commits January 6, 2026 19:39
… custom meta properties

This commit modifies `useField` to subscribe to the entire `state.meta` object instead of granular properties. This ensures that custom meta properties (like `hidden`) added by users trigger re-renders when updated.

To mitigate performance regressions (specifically array fields re-rendering on every child update due to `isDirty`/`isTouched` refresh), `FormApi.setFieldValue` is optimized to skip `setFieldMeta` if the meta state is already correct. This ensures `meta` object reference stability when relevant state hasn't changed.

Added regression test `tests/issue-1980.test.tsx`.
Updated `tests/useField.test.tsx` to accommodate the slight behavior change (initial re-render due to `isDefaultValue` change).
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.

1 participant