Formik: What difference between use cases?: submit Form and handleSubmit

Created on 20 Oct 2018  路  4Comments  路  Source: formium/formik

鉂換uestion

Looking at the source, it seems that submitForm is used for handleSubmit.

What is the difference between these two use cases?

I used to be ReactNative before, as follows.

  • handleSubmit: caused an error (related to binding?)
  • submitForm: no error

I want to understand why submitForm was solved, but I could not understand it even by looking at the document.
Could anyone tell me?

(sorry if duplicate it.)

Most helpful comment

@buschco use <Button onPress={handleSubmit} /> as documented here:

https://jaredpalmer.com/formik/docs/guides/react-native

All 4 comments

handleSubmit can be passed as is to a form's onSubmit event and preventDefault. submitForm cannot.

@jaredpalmer
thanks. I could understand.

it's close.

Is there any difference for react-native? Which one should I use 馃

@buschco use <Button onPress={handleSubmit} /> as documented here:

https://jaredpalmer.com/formik/docs/guides/react-native

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeffbski picture jeffbski  路  3Comments

sibelius picture sibelius  路  3Comments

outaTiME picture outaTiME  路  3Comments

PeerHartmann picture PeerHartmann  路  3Comments

jaredpalmer picture jaredpalmer  路  3Comments