react-i18next 14.0.8 → 14.1.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 +4 -0
- package/TransWithoutContext.d.ts +6 -4
- package/dist/es/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
### 14.1.0
|
|
2
|
+
|
|
3
|
+
- types(`Trans`): add typechecking on context prop [1732](https://github.com/i18next/react-i18next/pull/1732) (might brake if using "internal" `Trans` or `TransProps`)
|
|
4
|
+
|
|
1
5
|
### 14.0.8
|
|
2
6
|
|
|
3
7
|
- fix: issue [1728](https://github.com/i18next/react-i18next/issues/1728) when useSuspense is false and default ns [1731](https://github.com/i18next/react-i18next/pull/1731)
|
package/TransWithoutContext.d.ts
CHANGED
|
@@ -7,14 +7,15 @@ type TransChild = React.ReactNode | Record<string, unknown>;
|
|
|
7
7
|
export type TransProps<
|
|
8
8
|
Key extends ParseKeys<Ns, TOpt, KPrefix>,
|
|
9
9
|
Ns extends Namespace = _DefaultNamespace,
|
|
10
|
-
TOpt extends TOptions = {},
|
|
11
10
|
KPrefix = undefined,
|
|
11
|
+
TContext extends string | undefined = undefined,
|
|
12
|
+
TOpt extends TOptions & { context?: TContext } = { context: TContext },
|
|
12
13
|
E = React.HTMLProps<HTMLDivElement>,
|
|
13
14
|
> = E & {
|
|
14
15
|
children?: TransChild | readonly TransChild[];
|
|
15
16
|
components?: readonly React.ReactElement[] | { readonly [tagName: string]: React.ReactElement };
|
|
16
17
|
count?: number;
|
|
17
|
-
context?:
|
|
18
|
+
context?: TContext;
|
|
18
19
|
defaults?: string;
|
|
19
20
|
i18n?: i18n;
|
|
20
21
|
i18nKey?: Key | Key[];
|
|
@@ -29,7 +30,8 @@ export type TransProps<
|
|
|
29
30
|
export function Trans<
|
|
30
31
|
Key extends ParseKeys<Ns, TOpt, KPrefix>,
|
|
31
32
|
Ns extends Namespace = _DefaultNamespace,
|
|
32
|
-
TOpt extends TOptions = {},
|
|
33
33
|
KPrefix = undefined,
|
|
34
|
+
TContext extends string | undefined = undefined,
|
|
35
|
+
TOpt extends TOptions & { context?: TContext } = { context: TContext },
|
|
34
36
|
E = React.HTMLProps<HTMLDivElement>,
|
|
35
|
-
>(props: TransProps<Key, Ns,
|
|
37
|
+
>(props: TransProps<Key, Ns, KPrefix, TContext, TOpt, E>): React.ReactElement;
|
package/dist/es/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"14.0
|
|
1
|
+
{"type":"module","version":"14.1.0"}
|