Skip to content
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

Change in the order of Hooks #934

Closed
onestopjs opened this issue Sep 7, 2019 · 2 comments
Closed

Change in the order of Hooks #934

onestopjs opened this issue Sep 7, 2019 · 2 comments

Comments

@onestopjs
Copy link
Contributor

Describe the bug
The rule of Hooks is broken in the useTranslation hook.

Occurs in react-i18next version
I believe the commit that first introduced it is 0fafb4563a9c852792bd6851b45008d1315566f0.
Here is the exact place in the current version

To Reproduce
N/A

Expected behaviour
All hooks should be called every render in the same order.

Screenshots
N/A

OS (please complete the following information):
N/A

Additional context
I am not familiar with the internal workings of i18next, so I can not give exact steps to reproduce, but I get the warning when I switch pages in Gatsby, although it probably happens in other situations too.

@onestopjs
Copy link
Contributor Author

onestopjs commented Sep 7, 2019

I made a Pull Request, which I think fixes the problem - #935

@onestopjs
Copy link
Contributor Author

I am closing this issue as my PR has been merged and the issue has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant