From e7eb57783750397dea6956ce9f03f49684c6b6e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnar=20K=C3=A1ri=20=C3=81g=C3=BAstsson?= Date: Tue, 7 Sep 2021 09:41:08 +0000 Subject: [PATCH] fix: Move hook out of condition (#1410) Co-authored-by: Isaac Hinman --- src/appWithTranslation.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/appWithTranslation.tsx b/src/appWithTranslation.tsx index 0e70fb89..b220dda4 100644 --- a/src/appWithTranslation.tsx +++ b/src/appWithTranslation.tsx @@ -51,12 +51,12 @@ export const appWithTranslation = ( lng: initialLocale, resources: initialI18nStore, })) - - useMemo(() => { - globalI18n = i18n - }, [i18n]) } + useMemo(() => { + globalI18n = i18n + }, [i18n]) + return i18n !== null ? (