Replies: 1 comment 1 reply
-
<Select {...register(name, { onChange })} /> or const registerProps = register(name, { onChange: (value) => { ... } })
return <Select {...registerProps} /> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a code like this:
and I need to call the original
onChange
but when I do like:The value is not set and the form isn't being revalidated. This is very strange because in this case it's not clear how RHF gets values.
So I have to update form values and trigger validation manually:
but this also doesn't work well, as my Select component doesn't get a value when I pick it for the first time. Later on, however, it begins to work.
Any ideas how to correctly call original onChange?
Beta Was this translation helpful? Give feedback.
All reactions