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

Correct usage of react-i18next inside useEffect? #107

Open
ICTEnablers opened this issue Nov 18, 2019 · 0 comments
Open

Correct usage of react-i18next inside useEffect? #107

ICTEnablers opened this issue Nov 18, 2019 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@ICTEnablers
Copy link
Collaborator

When implementing react-i18next there are scenarios when a call needs to be made to t(...) (from i18n) or i18n.language inside a useEffect. This generates a dependency warning for t(..) and i18n. I don't think it should be a dependency since we do not want to update based on what's in t(..) or i18n.language?

Added the line:
// eslint-disable-next-line react-hooks/exhaustive-deps

To ignore these warnings.

Is there a better way to handle these issues?

@ICTEnablers ICTEnablers added the help wanted Extra attention is needed label Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant