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

EmmaSimon commented Dec 15, 2017

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

This comment has been minimized.

Copy link

coveralls commented Dec 15, 2017

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
3 checks passed
3 checks passed
codeclimate 2 fixed issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 81.328%
Details
@jamuhl

This comment has been minimized.

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
Projects
None yet
3 participants
You can’t perform that action at this time.