You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my app we use some dynamically loaded translation files where the namespace is not in serverSideTranslations and instead we use the ready flag (from useTranslation) to determine when the translations are available on the client.
Recently we've noticed that the ready flag ALWAYS returns true on the server, but then false on the initial client render when the ns is not SSRed. This causes a hydration error.
on server side it always tries to load all namespaces... and the ready flag is always true on server side, since there is no suspense...
there is not much we can do here...
@adrai It looks like even the client-page example in the i18next-http-backend repo (here) causes a hydration error because ready is true on the server. What is the recommended way to load translations on the fly for dynamic components that aren't in the initial page render?
^ this is from the next-i18next docs (here) but it seems like using the ready flag at all will cause re-render issues
🐛 Bug Report
In my app we use some dynamically loaded translation files where the namespace is not in
serverSideTranslations
and instead we use theready
flag (fromuseTranslation
) to determine when the translations are available on the client.Recently we've noticed that the ready flag ALWAYS returns
true
on the server, but thenfalse
on the initial client render when the ns is not SSRed. This causes a hydration error.To Reproduce
A minimal reproducible example. (slightly modified from the example auto-static-optimize)
link to component: https://github.com/arishoham/broken-i18n-ready-flag/blob/main/components/TestComponent.tsx
Expected behavior
I expect on the server
ready
to befalse
because thesecond-page
namespace is not inserverSideTranslations
(here).Your Environment (for my actual app)
The text was updated successfully, but these errors were encountered: