From a0be35db8b35fe8482a2fa637dc31482f736d196 Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 7 Sep 2022 13:39:54 +0200 Subject: [PATCH] Fix compat with StrictMode react 18 --- src/lib/i18n/index.tsx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lib/i18n/index.tsx b/src/lib/i18n/index.tsx index 5e63620e..289ce92c 100644 --- a/src/lib/i18n/index.tsx +++ b/src/lib/i18n/index.tsx @@ -83,8 +83,6 @@ export function __unsafe_useI18n(params: return; } - let isMounted = true; - refHasStartedFetching.current = true; (async () => { @@ -144,10 +142,6 @@ export function __unsafe_useI18n(params: })() ]).then(modules => modules.map(module => module.default)); - if (!isMounted) { - return; - } - setI18n({ ...createI18nTranslationFunctions({ "fallbackMessages": { @@ -180,10 +174,6 @@ export function __unsafe_useI18n(params: ) }); })(); - - return () => { - isMounted = false; - }; }, []); return i18n ?? null;