Add onsubmit event on onSubmit hook
Author: LarsFliegerCreated Jun 17, 2023Updated Jul 14, 2026
LabelsType: Feature Request
Feature request
Current Behavior
The onSubmit provides onSubmit: (values: Values, formikBag: FormikBag) => void | Promise<any>
Desired Behavior
Can we get the original button event as a third parameter. This is super useful when dealing with multiple submit buttons or other stuff.
Suggested Solution
onSubmit: (values: Values, formikBag: FormikBag, event: React.FormEvent<HTMLFormElement>) => void | Promise<any>
Who does this impact? Who is this for?
A few people require doing this:
Source: jaredpalmer/formik