react hook form submit outside form

JavaScript
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>
Source

Also in JavaScript: