From de08b73e084d22193f8e70c8bab05b26765804b9 Mon Sep 17 00:00:00 2001 From: Khondaker97 Date: Mon, 29 Aug 2022 13:43:51 +0600 Subject: [PATCH] Update validation-schema.ts Optional chaining will help us to avoid undefined value in place of certain type config. --- src/utils/validation-schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/validation-schema.ts b/src/utils/validation-schema.ts index 68e4b07..c24df59 100644 --- a/src/utils/validation-schema.ts +++ b/src/utils/validation-schema.ts @@ -29,7 +29,7 @@ export default [ .test( "len", `${zipcode.invalidErrorMsg}`, - (val) => val && val.length === 5 + (val) => val?.length === 5 ), [country.name]: yup .string()