From 7acc8be985fb1e5d294d267ec9284b07e1a4bef5 Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Wed, 13 Nov 2024 17:40:18 +0530 Subject: [PATCH] Fix bug with recursion (#9100) --- src/components/Facility/ConsultationDetails/index.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/Facility/ConsultationDetails/index.tsx b/src/components/Facility/ConsultationDetails/index.tsx index ec26dfe1a1d..463a4037fc9 100644 --- a/src/components/Facility/ConsultationDetails/index.tsx +++ b/src/components/Facility/ConsultationDetails/index.tsx @@ -72,15 +72,12 @@ const defaultTabs = { export const ConsultationDetails = (props: any) => { const { facilityId, patientId, consultationId } = props; const { t } = useTranslation(); - const [tabs, setTabs] = - useState>>(defaultTabs); const pluginTabs = useCareAppConsultationTabs(); - useEffect(() => { - if (pluginTabs) { - setTabs((prev) => ({ ...prev, ...pluginTabs })); - } - }, [pluginTabs]); + const tabs: Record> = { + ...defaultTabs, + ...pluginTabs, + }; let tab = undefined; if (Object.keys(tabs).includes(props.tab.toUpperCase())) {