We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug The reference of t function that returns from useI18n and useScopedI18n is not stable.
To Reproduce reproduce:
Expected behavior The reference of the t function should be stable so it will not cause a re-calculate when it is used in any hook dependency array.
Screenshots after each re-render the useEffect that has only t function dependency is refiring.
About (please complete the following information):
Workaround
For know I have wrapped the function with one useState hook.
import { useState } from 'react'; import { useI18n } from '@/locale'; export const useTranslate = () => { const [t] = useState<ReturnType<typeof useI18n>>(() => useI18n()); return t; };
The text was updated successfully, but these errors were encountered:
@QuiiBz thansk for fix. When You are planing the release with fixes?
Sorry, something went wrong.
I'd like to merge #316 that fixes another issue before landing a new release.
Hi! @QuiiBz Is there a date to expect the release of a new version including this fix? Thanks 👌
Sorry for the delay - https://github.com/QuiiBz/next-international/releases/tag/1.2.0 has been published!
Successfully merging a pull request may close this issue.
Describe the bug
The reference of t function that returns from useI18n and useScopedI18n is not stable.
To Reproduce
reproduce:
Expected behavior
The reference of the t function should be stable so it will not cause a re-calculate when it is used in any hook dependency array.
Screenshots
after each re-render the useEffect that has only t function dependency is refiring.
About (please complete the following information):
Workaround
For know I have wrapped the function with one useState hook.
The text was updated successfully, but these errors were encountered: