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

Add optional defaultNS #1050

Merged
merged 2 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export function withTranslation(

export interface I18nextProviderProps {
i18n: i18n;
defaultNS: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a required property, only i18n is. This should be defaultNS?: string. Leaving the test as-is and adding another would prove this true in the future.

}

export const I18nextProvider: React.FunctionComponent<I18nextProviderProps>;
Expand Down
2 changes: 1 addition & 1 deletion test/typescript/I18nextProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ i18next.use(initReactI18next).init({
function test() {
return (
<React.Suspense fallback={<p>Loading</p>}>
<I18nextProvider i18n={i18next}>
<I18nextProvider i18n={i18next} defaultNS={'translations'}>
rosskevin marked this conversation as resolved.
Show resolved Hide resolved
<h1>Foo</h1>
</I18nextProvider>
</React.Suspense>
Expand Down