From 8830f2eb69a39eb22131e8b554913b5fe2fc1165 Mon Sep 17 00:00:00 2001 From: Aseer KT <39845171+aseerkt@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:08:41 +0530 Subject: [PATCH] fix: double render due to wrong assertion (#1817) Co-authored-by: Aseer KT --- examples/nextjs-swc/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nextjs-swc/src/utils.ts b/examples/nextjs-swc/src/utils.ts index db3c8c628..e87030fd6 100644 --- a/examples/nextjs-swc/src/utils.ts +++ b/examples/nextjs-swc/src/utils.ts @@ -18,7 +18,7 @@ export function useLinguiInit(messages: Messages) { // to avoid calling loadAndActivate for (worst case) each request, but right now that's what we do i18n.loadAndActivate({ locale, messages }) } - if (isClient && i18n.locale === undefined) { + if (isClient && !i18n.locale) { // first client render i18n.loadAndActivate({ locale, messages }) }