Skip to content

Comments

feat: align Watch API with useWatch#13192

Merged
bluebill1049 merged 8 commits intoreact-hook-form:masterfrom
dusan233:refactor-watch-component
Dec 12, 2025
Merged

feat: align Watch API with useWatch#13192
bluebill1049 merged 8 commits intoreact-hook-form:masterfrom
dusan233:refactor-watch-component

Conversation

@dusan233
Copy link
Contributor

@dusan233 dusan233 commented Dec 11, 2025

I noticed that the documentation suggests the Watch component can be used similarly to the useWatch hook. However, the current Watch API does not support props such as disabled, defaultValue, exact and compute, uses a names prop instead of name, and only accepts an array of field names.

This PR changes:

  1. Adds support for disabled, exact, defaultValue and compute props.
  2. Renames the names prop to name and allows subscribing to a single field, an array of fields, or the entire form.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@bluebill1049
Copy link
Member

bluebill1049 commented Dec 11, 2025

could u point this change to this branch? #12333 as there is a breaking change on the names which i failed to picked up in the original PR.

@bluebill1049
Copy link
Member

or you can fix the rest without change the names prop

@bluebill1049
Copy link
Member

i have updated the v8 to name as a breaking change, if you can keep the names for v7 and apply the rest of the change plz

@bluebill1049 bluebill1049 merged commit 2a681a9 into react-hook-form:master Dec 12, 2025
6 checks passed
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.

2 participants