Answers for "react hook form submit outside form"

0

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>
Posted by: Guest on January-26-2021

Code answers related to "react hook form submit outside form"

Code answers related to "Javascript"

Browse Popular Code Answers by Language