From 7d68dbaab2766db368a41d7edf169f685d515459 Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Thu, 28 Nov 2024 18:06:44 +0100 Subject: [PATCH] fix: SW-1040 Fixed ref issue by removing extra props --- .../ChildSelector/ChildInfoSelector.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/components/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx b/components/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx index a74b52200..95bb9fc0c 100644 --- a/components/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx +++ b/components/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx @@ -33,7 +33,7 @@ export default function ChildInfoSelector({ const ageLabel = intl.formatMessage({ id: "Age" }) const bedLabel = intl.formatMessage({ id: "Bed" }) const errorMessage = intl.formatMessage({ id: "Child age is required" }) - const { setValue, formState, register } = useFormContext() + const { setValue, formState } = useFormContext() function updateSelectedBed(bed: number) { setValue(`rooms.${roomIndex}.child.${index}.bed`, bed) @@ -95,9 +95,7 @@ export default function ChildInfoSelector({ }} placeholder={ageLabel} maxHeight={180} - {...register(ageFieldName, { - required: true, - })} + name={ageFieldName} isNestedInModal={true} /> @@ -112,9 +110,7 @@ export default function ChildInfoSelector({ updateSelectedBed(key as number) }} placeholder={bedLabel} - {...register(bedFieldName, { - required: true, - })} + name={bedFieldName} isNestedInModal={true} /> ) : null}