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
and then if we switch locale - the hook is not rerunning and page is not rerendered. workaround here is explicitly add locale from router to useMemo deps array:
but this workaround causes eslint-react-hooks error since locale is not used inside hook but still present in its deps array. it looks like t function should change in locale change.
in examples below assuming that navigation is something like:
I think that implementation with refs is quite good since it fixes bug with stale dict during next page transitions. For the same reason we can't switch to 1.x.x version.
Unfortunately I have no time right now to figure out how to fix t func in next-rosetta codebase, but I will try later!
It looks like we should add locale to deps somewhere inside provider/hook and then return new t every time locale changes.
hello and thank you for your package!
we use it since first releases and happy now with removing state from provider and new ref implementation. bug with stale dict affected us too.
for now we noticed one more bug and it looks like it is connected with refs implementation.
the
t
function fromuseI18n
hook is not changing when locale is switched.so if we have something like:
and then if we switch locale - the hook is not rerunning and page is not rerendered. workaround here is explicitly add
locale
from router touseMemo
deps array:but this workaround causes eslint-react-hooks error since locale is not used inside hook but still present in its deps array. it looks like
t
function should change in locale change.in examples below assuming that
navigation
is something like:and our
locale
is:The text was updated successfully, but these errors were encountered: