From a29f858547cec29ad026c8528cb5a4227fde8fab Mon Sep 17 00:00:00 2001 From: Kridsakorn Date: Sun, 29 Sep 2024 21:34:20 +0700 Subject: [PATCH] fix issue #3455 --- .changeset/mean-deers-repeat.md | 5 +++++ packages/formik/src/types.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/mean-deers-repeat.md diff --git a/.changeset/mean-deers-repeat.md b/.changeset/mean-deers-repeat.md new file mode 100644 index 000000000..8549c7d82 --- /dev/null +++ b/.changeset/mean-deers-repeat.md @@ -0,0 +1,5 @@ +--- +'formik': major +--- + +fix issue #3455 diff --git a/packages/formik/src/types.tsx b/packages/formik/src/types.tsx index 71db6792c..d0a34cdd3 100644 --- a/packages/formik/src/types.tsx +++ b/packages/formik/src/types.tsx @@ -27,8 +27,8 @@ export type FormikErrors = { export type FormikTouched = { [K in keyof Values]?: Values[K] extends any[] ? Values[K][number] extends object // [number] is the special sauce to get the type of array's element. More here https://github.com/Microsoft/TypeScript/pull/21316 - ? FormikTouched[] - : boolean + ? FormikTouched[] | boolean | boolean[] + : boolean | boolean[] : Values[K] extends object ? FormikTouched : boolean;