The imperative version of <Form> that lets you submit a form from code instead of a user interaction.
<Form>
import { useSubmit } from "react-router";function SomeComponent() { const submit = useSubmit(); return ( <Form onChange={(event) => { submit(event.currentTarget); }} /> );} Copy
import { useSubmit } from "react-router";function SomeComponent() { const submit = useSubmit(); return ( <Form onChange={(event) => { submit(event.currentTarget); }} /> );}
The imperative version of
<Form>
that lets you submit a form from code instead of a user interaction.