Skip to content

Commit

Permalink
Move conditional rendering inside an if block
Browse files Browse the repository at this point in the history
  • Loading branch information
ivonne-hernandez committed Dec 18, 2024
1 parent 5c3d02a commit a9f56c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Components/RHFComponents/RHFOptionCardGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const RHFOptionCardGroup = <T extends FieldValues>({
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<any, any>, name: string, values: Record<string, boolean>) => {
Expand Down

0 comments on commit a9f56c4

Please sign in to comment.