Skip to content

Commit

Permalink
Fix: return onSubmit promise result in submission (jaredpalmer#2420)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmartinsky committed May 28, 2020
1 parent 3bf7246 commit a9dee8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/formik/src/Formik.tsx
Expand Up @@ -775,10 +775,11 @@ export function useFormik<Values extends FormikValues = FormikValues>({
}

return Promise.resolve(promiseOrUndefined)
.then(() => {
.then(result => {
if (!!isMounted.current) {
dispatch({ type: 'SUBMIT_SUCCESS' });
}
return result;
})
.catch(_errors => {
if (!!isMounted.current) {
Expand Down

0 comments on commit a9dee8a

Please sign in to comment.