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

Allow translate HOC to take a function #372

Merged
merged 1 commit into from
Dec 16, 2017
Merged

Conversation

EmmaSimon
Copy link
Contributor

For #369. It was slightly more complicated than just adding if (typeof namespaces === 'function') namespaces = namespaces(props);, because when multiple of the same component were rendered, only the first one would run the function, then the closure in the HOC would have that result set to namespaces for every other.

I'm not certain if Translate.namespaces was being used elsewhere, but now that value can also be a function. If that'll cause issues, let me know and I'll try to implement it another way.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 81.328% when pulling 28a841b on EmmaSimon:master into 465b95e on i18next:master.

@jamuhl jamuhl merged commit 79d22f3 into i18next:master Dec 16, 2017
@jamuhl
Copy link
Member

jamuhl commented Dec 16, 2017

published with react-i18next@7.3.0

thank you for contributing

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

Successfully merging this pull request may close these issues.

3 participants