react-i18next 12.3.1 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/TransWithoutContext.d.ts +26 -16
- package/dist/amd/react-i18next.js +827 -1130
- package/dist/amd/react-i18next.min.js +1 -1
- package/dist/commonjs/I18nextProvider.js +10 -13
- package/dist/commonjs/Trans.js +37 -52
- package/dist/commonjs/TransWithoutContext.js +130 -168
- package/dist/commonjs/Translation.js +8 -22
- package/dist/commonjs/context.js +45 -76
- package/dist/commonjs/defaults.js +7 -16
- package/dist/commonjs/i18nInstance.js +2 -4
- package/dist/commonjs/index.js +52 -86
- package/dist/commonjs/initReactI18next.js +2 -5
- package/dist/commonjs/unescape.js +4 -11
- package/dist/commonjs/useSSR.js +10 -14
- package/dist/commonjs/useTranslation.js +47 -82
- package/dist/commonjs/utils.js +29 -52
- package/dist/commonjs/withSSR.js +9 -23
- package/dist/commonjs/withTranslation.js +18 -45
- package/dist/es/I18nextProvider.js +10 -10
- package/dist/es/Trans.js +36 -43
- package/dist/es/TransWithoutContext.js +129 -159
- package/dist/es/Translation.js +7 -14
- package/dist/es/context.js +30 -50
- package/dist/es/defaults.js +7 -10
- package/dist/es/i18nInstance.js +1 -1
- package/dist/es/index.js +6 -18
- package/dist/es/initReactI18next.js +2 -2
- package/dist/es/package.json +1 -1
- package/dist/es/unescape.js +4 -10
- package/dist/es/useSSR.js +10 -11
- package/dist/es/useTranslation.js +47 -75
- package/dist/es/utils.js +25 -43
- package/dist/es/withSSR.js +9 -15
- package/dist/es/withTranslation.js +17 -35
- package/dist/umd/react-i18next.js +828 -1131
- package/dist/umd/react-i18next.min.js +1 -1
- package/helpers.d.ts +3 -0
- package/icu.macro.d.ts +37 -39
- package/index.d.ts +44 -37
- package/initReactI18next.d.ts +1 -1
- package/package.json +36 -36
- package/react-i18next.js +828 -1131
- package/react-i18next.min.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
### 13.0.0
|
|
2
|
+
|
|
3
|
+
- Update types to support t function redesign [1615](https://github.com/i18next/react-i18next/pull/1615)
|
|
4
|
+
- requires i18next >= v23.0.1
|
|
5
|
+
|
|
1
6
|
### 12.3.1
|
|
2
7
|
|
|
3
8
|
- optimization for optional lng prop for useTranslation, should now prevent missings when lazy loading translations [1637](https://github.com/i18next/react-i18next/issues/1637)
|
package/TransWithoutContext.d.ts
CHANGED
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
i18n,
|
|
3
|
+
ParseKeys,
|
|
4
|
+
Namespace,
|
|
5
|
+
TypeOptions,
|
|
6
|
+
TOptions,
|
|
7
|
+
TFunction,
|
|
8
|
+
KeyPrefix,
|
|
9
|
+
} from 'i18next';
|
|
2
10
|
import * as React from 'react';
|
|
3
11
|
|
|
4
|
-
type
|
|
12
|
+
type _DefaultNamespace = TypeOptions['defaultNS'];
|
|
5
13
|
|
|
6
14
|
type TransChild = React.ReactNode | Record<string, unknown>;
|
|
7
15
|
export type TransProps<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
Key extends ParseKeys<Ns, TOpt, KPrefix>,
|
|
17
|
+
Ns extends Namespace = _DefaultNamespace,
|
|
18
|
+
TOpt extends TOptions = {},
|
|
19
|
+
KPrefix = undefined,
|
|
20
|
+
E = React.HTMLProps<HTMLDivElement>,
|
|
12
21
|
> = E & {
|
|
13
|
-
children?: TransChild | TransChild[];
|
|
22
|
+
children?: TransChild | readonly TransChild[];
|
|
14
23
|
components?: readonly React.ReactElement[] | { readonly [tagName: string]: React.ReactElement };
|
|
15
24
|
count?: number;
|
|
16
25
|
context?: string;
|
|
17
26
|
defaults?: string;
|
|
18
27
|
i18n?: i18n;
|
|
19
|
-
i18nKey?:
|
|
20
|
-
ns?:
|
|
28
|
+
i18nKey?: Key | Key[];
|
|
29
|
+
ns?: Ns;
|
|
21
30
|
parent?: string | React.ComponentType<any> | null; // used in React.createElement if not null
|
|
22
|
-
tOptions?:
|
|
31
|
+
tOptions?: TOpt;
|
|
23
32
|
values?: {};
|
|
24
33
|
shouldUnescape?: boolean;
|
|
25
|
-
t?: TFunction<
|
|
34
|
+
t?: TFunction<Ns, KPrefix>;
|
|
26
35
|
};
|
|
27
36
|
|
|
28
37
|
export function Trans<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
Key extends ParseKeys<Ns, TOpt, KPrefix>,
|
|
39
|
+
Ns extends Namespace = _DefaultNamespace,
|
|
40
|
+
TOpt extends TOptions = {},
|
|
41
|
+
KPrefix extends KeyPrefix<Ns> = undefined,
|
|
42
|
+
E = React.HTMLProps<HTMLDivElement>,
|
|
43
|
+
>(props: TransProps<Key, Ns, TOpt, KPrefix, E>): React.ReactElement;
|