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
It seems type indicates who initiated the update, because a user change results in type: 'change', while a setValue call results in type: undefined. I'm actually using it avoid endless watch calls as I call setValue inside watch, which results in a new watch callback call. I'd like to ask for documentation of this type field.
Describe the solution you'd like
Document the possible options for the type attribute in watch callback.
Describe alternatives you've considered
I can probably hunt down all usages within the code but it seems suboptimal. The current documentation just mentions the presence of this field and it's even typed as just string, which doesn't convey much information about it.
Additional context React Hook Form seems like a really neat and advanced library - well done!
The text was updated successfully, but these errors were encountered:
vladev
changed the title
Document watch type callback parameter
Document watch callback type parameter
Jan 10, 2024
Is your feature request related to a problem? Please describe.
Using the
watch
API inuseEffect
like so:It seems
type
indicates who initiated the update, because a user change results intype: 'change'
, while asetValue
call results intype: undefined
. I'm actually using it avoid endless watch calls as I callsetValue
insidewatch
, which results in a newwatch
callback call. I'd like to ask for documentation of thistype
field.Describe the solution you'd like
Document the possible options for the
type
attribute inwatch
callback.Describe alternatives you've considered
I can probably hunt down all usages within the code but it seems suboptimal. The current documentation just mentions the presence of this field and it's even typed as just
string
, which doesn't convey much information about it.Additional context
React Hook Form seems like a really neat and advanced library - well done!
The text was updated successfully, but these errors were encountered: