Skip to content

Commit

Permalink
fix: double render due to wrong assertion (#1817)
Browse files Browse the repository at this point in the history
Co-authored-by: Aseer KT <aseer@wednesday.is>
  • Loading branch information
aseerkt and aseer-ws authored Dec 14, 2023
1 parent 0ab1ccb commit 8830f2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/nextjs-swc/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
Expand Down

1 comment on commit 8830f2e

@vercel
Copy link

@vercel vercel bot commented on 8830f2e Dec 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.