From a9f56c4d46502da7d03e2e111e97ebde195df987 Mon Sep 17 00:00:00 2001 From: Ivonne Hernandez Date: Wed, 18 Dec 2024 10:17:08 -0700 Subject: [PATCH] Move conditional rendering inside an if block --- src/Components/RHFComponents/RHFOptionCardGroup.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Components/RHFComponents/RHFOptionCardGroup.tsx b/src/Components/RHFComponents/RHFOptionCardGroup.tsx index 6097eb6b..49bdadb2 100644 --- a/src/Components/RHFComponents/RHFOptionCardGroup.tsx +++ b/src/Components/RHFComponents/RHFOptionCardGroup.tsx @@ -35,7 +35,9 @@ const RHFOptionCardGroup = ({ const updatedValue = !fields[optionName]; setValue(`${name}.${optionName}`, updatedValue, { shouldValidate: true, shouldDirty: true }); - triggerValidation && await triggerValidation(name); + if (triggerValidation) { + await triggerValidation(name); + } }; const displayOptionCards = (options: Record, name: string, values: Record) => {