Unform

Manual form submit

With Unform you can submit your form without a submit button using the submitForm function exposed by form reference.

1export default function SignIn() {
2 const formRef = useRef(null);
3
4 function functionThatSubmitsForm() {
5 formRef.current.submitForm();
6 }
7
8 return (
9 <Form ref={formRef} onSubmit={handleSubmit}>
10 <Input name="email" type="email" />
11 <Input name="password" type="password" />
12 </Form>
13 );
14}
Edit this page on GitHub