Skip to content

Commit

Permalink
types: reportNamespaces is now optional, should fix #1693
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Dec 21, 2023
1 parent fdab4e8 commit 7e88547
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 14.0.0

- types: reportNamespaces is now optional, should fix [1693](https://github.com/i18next/react-i18next/issues/1693)

### 13.5.0

- self-closing components in translation strings should not attempt to replace the component's children [1695](https://github.com/i18next/react-i18next/issues/1695)
Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export interface ReportNamespaces {

declare module 'i18next' {
// interface i18n {
// reportNamespaces: ReportNamespaces;
// reportNamespaces?: ReportNamespaces;
// }
interface CustomInstanceExtenstions {
reportNamespaces: ReportNamespaces;
reportNamespaces?: ReportNamespaces;
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/typescript/context.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useContext } from 'react';
import i18next from 'i18next';
import { I18nContext } from 'react-i18next';

i18next.reportNamespaces.addUsedNamespaces(['translation']);
i18next.reportNamespaces.getUsedNamespaces();
i18next?.reportNamespaces?.addUsedNamespaces(['translation']);
i18next?.reportNamespaces?.getUsedNamespaces();

function ContextConsumer() {
const { i18n } = useContext(I18nContext);
Expand Down

0 comments on commit 7e88547

Please sign in to comment.