On form submission onSubmit is not being called in
onSubmit should be called with the form values
Codesandbox link:
Formik template: https://codesandbox.io/s/cocky-mcnulty-dyx26
I don't know why onSubmit is not being called.
| Software | Version(s) |
| ---------------- | ---------- |
| Formik | 1.5.8
| React | 16.8.6
| TypeScript | 3.5.3
| Browser | chrome
| npm/Yarn | 6.9.0/1.17.0
| Operating System | macOS Mojave
You're missing an inner <form> element and handleSubmit should be attached to that form element, not the submit button.
Also your onChange handlers should be simplified to onChange={handleChange}
Found the issue. onSubmit will be called if the form is valid. I wasn't entering a valid email.
Most helpful comment
Found the issue.
onSubmitwill be called if the form is valid. I wasn't entering a valid email.