-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
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
react-hooks example is broken #642
Comments
Can't reproduce...thowing promise triggers the suspense |
@jamuhl did you clone a fresh repo, or reuse an existing one? If you clone fresh and |
just tried removed node_modules, lockfiles -> updated dep. to alpha.2 -> npm i -> npm start -> all runs node 9.3 here...but that should be irrelevant. |
Dang, what could be the difference between your environment and mine then? I'm able to repro in every browser installed on my computer (Chrome, Safari, Firefox, Opera), and I just ran the steps above:
|
Ok, the problem seems to be that If I open Do you happen to have a cookie, or something else, that's telling |
I can repro when I try to load any locale that's not exactly |
ah...now I see...yes...will need to think how to solve this: https://github.com/i18next/react-i18next/blob/master/src/hooks/useTranslation.js#L42 check for |
@jamuhl awesome, thanks for looking into this! I'm really excited about this i18next hooks API! |
could you try with: react-i18next@8.3.9 please note:
|
@jamuhl it's working! |
Thank you very much for fixing it in such short notice! |
If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project -> there are many ways to help this project 🙏 |
Describe the bug
The
react-hooks
example in the repo seems to enter an infinite loop. My app experiences the same issue when usinguseTranslation
.Occurs in react-i18next version
Checked out commit 458d242.
To Reproduce
Steps to reproduce the behavior:
Expected behaviour
Page should load normally.
Screenshots
N/A
OS (please complete the following information):
Additional context
I think throwing the promise in
useTranslation
is what starts the infinite loop.The text was updated successfully, but these errors were encountered: