-
-
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
Translation reset after component is unmounted with useTranslation #801
Comments
ok this happens only in the non-suspense case -> so it's save to loadNamespaces in a useEffect for that case to keep that isMounted in a closure |
should be fixed in [email protected] 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 🙏 |
I can confirm this is fixed in the 10.6.0. Thank you for the quick fix and good luck with the locize! |
I am using react-i18next -11.3.1. I am still facing this issue. |
@TedSean please provide a codesandbox with reproduction case |
I've already mentioned this bug in the #796 (comment). If the namespace is loaded after the component is no longer mounted, the React logs errors
Occurs in latest stable at the time of writing - #15.0.6 and react-i18next#10.5.1.
To Reproduce
I've forked the code sandbox - https://codesandbox.io/s/qxj1xykyww
There is a custom backend that resolves only after 5 secs. Before it does, click on the "Toggle child" to remove the child. After 5 secs, error should appear in the console.
Expected behaviour
Loading should be either cancelled or reset should not happen if the component is not mounted anymore. Solution proposals mentioned in the #796 (comment)
The text was updated successfully, but these errors were encountered: