Skip to content

Commit

Permalink
Add optional defaultNS (#1050)
Browse files Browse the repository at this point in the history
* fix: add missing defaultNS

* fix: make defaultNS optional
  • Loading branch information
jpgarcia authored Feb 14, 2020
1 parent c764b02 commit 42f6824
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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;
}

export const I18nextProvider: React.FunctionComponent<I18nextProviderProps>;
Expand Down
10 changes: 10 additions & 0 deletions test/typescript/I18nextProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ function test() {
</React.Suspense>
);
}

function testDefaultNS() {
return (
<React.Suspense fallback={<p>Loading</p>}>
<I18nextProvider i18n={i18next} defaultNS={'translations'}>
<h1>Foo</h1>
</I18nextProvider>
</React.Suspense>
);
}

0 comments on commit 42f6824

Please sign in to comment.