You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: restore useField meta object reactivity sync (#5021)
Since v4.12.0, calling useField with the same path in multiple components
(e.g. parent and child) within the same form would create separate PathState
objects instead of sharing one. This broke meta object synchronization —
touching a field in the child would not update the parent's meta.
The regression was introduced when createPathState was changed to only reuse
existing path states for checkbox/radio fields. This restores the v4.11.8
behavior where all field types sharing a path reuse the same PathState,
while also:
- Adding a path identity check to avoid reusing stale path states in field
array scenarios where paths shift (e.g. after insert)
- Updating removePathState to properly decrement fieldsCount for all shared
fields (not just checkbox/radio)
- Fixing the unmount logic to handle array IDs for non-multiple shared fields
- Only unsetting path values on unmount when it is the last field or a
radio/checkbox group
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments