I am using Formik 2.1.4 and not sure if this is a bug or not but I am trying to use isSubmitting in an async function but it doesn't seem to work for me. According to what I saw in the docs you don't need to use set setSubmitting on submit like:
onSubmit={async (values, { setSubmitting }) => {
<Formik
// initial values
// validation Schema
onSubmit={async (values) => {
// http request here
>
{(formik, isSubmitting) => (
<Form>
// inputs
<Button
type="submit"
disabled={isSubmitting}
>
{isSubmitting ? `Submiting...` : `Submit`}
</Button>
</Form>
</Formik>
The button does not disable on submit nor does the button label text change.
In your example above, it should be formik.isSubmitting and you can remove the second arg to your child fn.
Ahah! Brilliant, thanks.
no problem!
Most helpful comment
In your example above, it should be
formik.isSubmittingand you can remove the second arg to your child fn.