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

Restore support passing the defaultNS as I18nextProvider prop #860

Merged
merged 1 commit into from
May 30, 2019

Conversation

alexbakum
Copy link
Contributor

During react-i18next evolved the support (introduced at #478) of defaultNS prop has been dropped from I18nextProvider. So attempting to restore it.
We're still looking forward to share same instance of i18next between different provider instances and hooks.

const i18n = /* some i18next instantiating */
const Translated = () => {
  const {t} = useTranslation();

  return (<div>{t('the_key')}</div>);
};
const FirstWrapper = () => (
  <I18nextProvider i18n={i18n} defaultNS="firstOne">
    <Translated />
  </I18nextProvider>
);
const SecondWrapper = () => (
  <I18nextProvider i18n={i18n} defaultNS="secondOne">
    <Translated />
  </I18nextProvider>
);

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.915% when pulling c8534e7 on alexbakum:restore-default-ns into 7d3056e on i18next:master.

@jamuhl jamuhl merged commit a52dcc7 into i18next:master May 30, 2019
@jamuhl
Copy link
Member

jamuhl commented May 30, 2019

thank you...was published in react-i18next@10.11.0

If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project -> there are many ways to help this project 🙏

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