From 0483a30b3273f92349280d687ff21473726f3c18 Mon Sep 17 00:00:00 2001 From: Omar ALKABOUSS MOUSSANA Date: Mon, 5 Aug 2024 18:23:17 +0200 Subject: [PATCH] fix(pci-private-network): fixed re-render issue on language change ref: PRB0041352 Signed-off-by: Omar ALKABOUSS MOUSSANA --- .../src/pages/new/steps/LocalizationStep.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/manager/apps/pci-private-network/src/pages/new/steps/LocalizationStep.tsx b/packages/manager/apps/pci-private-network/src/pages/new/steps/LocalizationStep.tsx index d090c3d35792..648a20a03acd 100644 --- a/packages/manager/apps/pci-private-network/src/pages/new/steps/LocalizationStep.tsx +++ b/packages/manager/apps/pci-private-network/src/pages/new/steps/LocalizationStep.tsx @@ -33,7 +33,7 @@ export default function LocalizationStep(): JSX.Element { const { t } = useTranslation('new'); const { t: tCommon } = useTranslation('common'); const { t: tRegion } = useTranslation('region'); - const { t: tRegions } = useTranslation('regions'); + const { t: tRegions, i18n } = useTranslation('regions'); const { data: regions, @@ -41,7 +41,6 @@ export default function LocalizationStep(): JSX.Element { } = useProjectAvailableRegions(store.project?.id); const [mappedRegions, setMappedRegions] = useState([]); - const [state, setState] = useState<{ selectedContinent: string }>({ selectedContinent: undefined, }); @@ -121,7 +120,7 @@ export default function LocalizationStep(): JSX.Element { setMappedRegions(result); } - }, [regions]); + }, [regions, i18n.language]); return (