Formik: Manually calling formik.submitForm() resolves with undefined

Created on 22 Nov 2019  路  9Comments  路  Source: formium/formik

馃殌 Feature request

Current Behavior

Calling formik.submitForm() promise manually, resolves always with undefined regardless of what my handler returns.

Desired Behavior


I'd like this to be resolved with the return value of my submit handler so I can decide what to do next.

https://codesandbox.io/s/inspiring-fog-9pmo8

Formik Validation

Most helpful comment

I experienced the issues too
the version i'am using is 2.1.4

All 9 comments

The issue I just had with this function was the promise not being rejected when the form is invalid.

The docs say this: The promise will be rejected if form is invalid.

I'm trying to figure out how to take action after an invalid submit without watching all the Formik state flags changing.

Also run into that, for anyone looking for a temp workaround:
use validateForm to check if there are any errors

Fixed in 2.1

I still experienced with the issues I don't know what is wrong

I experienced the issues too
the version i'am using is 2.1.4

Also getting undefined on 2.1.4.

Same, since combinedErrors is not an Error it doesn't throw.

re-opening as one more issue is reported - https://github.com/formium/formik/issues/2831

there is still no solution for that =0_0=

Was this page helpful?
0 / 5 - 0 ratings

Related issues

outaTiME picture outaTiME  路  3Comments

emartini picture emartini  路  3Comments

jordantrainor picture jordantrainor  路  3Comments

jaredpalmer picture jaredpalmer  路  3Comments

sibelius picture sibelius  路  3Comments