Ariakit
/

useFormSubmit

Registers a callback that will be used to submit the form when submit is called.

Live examples:

Code examples

useFormSubmit(form, async (state) => {
try {
await api.submit(state.values);
} catch (errors) {
form.setErrors(errors);
}
});

Stay tuned

Join 1,000+ subscribers and receive monthly tips & updates on new Ariakit content.

No spam. Unsubscribe anytime. Read latest issue