How can I validate and submit a form by clicking on an external component?
In the example below the form is sent without going through validation.
Codesandbox link
https://codesandbox.io/s/react-hook-form-cbc8c
handleSubmit(onSubmit)()
should be your answer. let me know if this doesn't solve your problem :)
handleSubmit(onSubmit)()
should be your answer. let me know if this doesn't solve your problem :)
@bluebill1049 Thanks.
I need the event to be fired from a parent component
consider move useForm to parent component :)