jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.93k stars 2.79k forks source link

FormikTouched is typed incorrectly for primitive array values #3455

Open kmurgic opened 2 years ago

kmurgic commented 2 years ago

Bug report

Current Behavior

For values { x: string [] }, touched is being typed as { x?: boolean }

Expected behavior

For values { x: string [] }, touched should be typed as { x?: boolean[] }

Reproducible example

https://codesandbox.io/s/infallible-shape-nhd9i?file=/index.tsx:537-685 Edit the names of one of the friends. Note that in the console touched.friends is an array of booleans.

Suggested solution(s)

Replace boolean with boolean[] here I ~plan on making~ opened up a one line PR.

kmurgic commented 2 years ago

Opened a PR

quantizor commented 1 week ago

I think this is intended behavior, touched is describing the field not the contents of the field.