-
I've included the contact form I'm working on below:
Note that I'm passing a prop named register to my custom form components, and then on the inputs inside them I'm spreading the call to the register function like so:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
One thing I notice is when I inspect the HTML, I see that the form tag is bare of attributes--even the onSubmit attribute. Also, my submit handler never fires either when I click the submit button. |
Beta Was this translation helpful? Give feedback.
-
I just used |
Beta Was this translation helpful? Give feedback.
-
Please provide a codesandbox url to re-produce the issue. |
Beta Was this translation helpful? Give feedback.
-
See answer above |
Beta Was this translation helpful? Give feedback.
@leapful The form I shared here is a pared-down version of the one I'm actually using that couldn't be put in a sandbox for technical reasons. But it came down to how I used
setValue
on a hidden input. At first I hadsetValue('recaptcha', token)
andObject.entries(errors).length
was still zero or falsey, butisValid
was also false. Then when I added optionssetValue('recaptcha', token, { shouldValidate: true }
,isValid
became true.