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

Conditional usage of hooks? #949

Closed
imbhargav5 opened this issue Sep 26, 2019 · 3 comments · Fixed by #951
Closed

Conditional usage of hooks? #949

imbhargav5 opened this issue Sep 26, 2019 · 3 comments · Fixed by #951

Comments

@imbhargav5
Copy link
Contributor

imbhargav5 commented Sep 26, 2019

Describe the bug
useSSR is utilising useContext conditionally and this is causing a bug.

const { i18n: i18nFromContext } = getHasUsedI18nextProvider() ? useContext(I18nContext) : {};

Occurs in react-i18next version
N/A

To Reproduce
N/A
Expected behaviour
N/A

Screenshots
N/A

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

Additional context
This occurs rarely.

@jamuhl
Copy link
Member

jamuhl commented Sep 26, 2019

It happens only if your app ist broken by using useTranslation outside of the Provider....but

feel free to provide the same fix like in #935 as a PR

@imbhargav5
Copy link
Contributor Author

@jamuhl Done

@jamuhl
Copy link
Member

jamuhl commented Sep 27, 2019

published in [email protected]

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