-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document watch callback type parameter #1040
Labels
Comments
vladev
changed the title
Document watch type callback parameter
Document watch callback type parameter
Jan 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: