Formik: isInitialValid now is required to make isValid flag false at startup

Created on 20 Nov 2019  路  5Comments  路  Source: formium/formik

馃悰 Bug report

Current Behavior

isValid is being flagged as true upon first entering the form.

Expected behavior

isValid should be marked as false, even if the isInitialValid property has not been set

Suggested solution(s)

document breaking changes, or not require isInitialValid to be set and still have isValid flag false

Additional context

This behavior was not seen in V1 and with the V2 update many changes were made and were not documented under breaking changes.

Your environment

| Software | Version(s) |
| ---------------- | ---------- |
| Formik | latest
| React | latest
| TypeScript |
| Browser | all
| npm/Yarn | latest
| Operating System | mac

stale

Most helpful comment

I fixed it with @sclavijo93 info, I just added:

<Formik
      validateOnMount
...

All 5 comments

Has anyone else noticed this behavior?

@mrowe009 I've noticed too. :(

But this part of the migration talks a litle about it
Line 236

I fixed it with @sclavijo93 info, I just added:

<Formik
      validateOnMount
...

@sclavijo93 i see now, that is very well hidden at the the bottom of the page. I didn't realize validateOnMount was running on its own in V1. I figured it was just a flag being set on initial render.

@difagume i also used that solution as well. but thanks for providing the solution so others can see 馃憤

bump

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sibelius picture sibelius  路  3Comments

Jungwoo-An picture Jungwoo-An  路  3Comments

emartini picture emartini  路  3Comments

najisawas picture najisawas  路  3Comments

jaredpalmer picture jaredpalmer  路  3Comments