react hook form submit outside form code example
Example: react hook form submit outside form
const { handleSubmit } = useForm();
const onSubmit = data => {
console.log(data);
};
//...
<form id="hook-form" onSubmit={handleSubmit(onSubmit)}>
{/* your awesome form */}
</form>
<button type="submit" form="hook-form">Submit</button>