react-i18next 11.16.8 → 11.16.11
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 +12 -0
- package/README.md +5 -3
- package/package.json +1 -1
- package/ts4.1/index.d.ts +21 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
### 11.16.11
|
|
2
|
+
|
|
3
|
+
- types: fix Translation component types regression [1511](https://github.com/i18next/react-i18next/pull/1511)
|
|
4
|
+
|
|
5
|
+
### 11.16.10
|
|
6
|
+
|
|
7
|
+
- types: translation component types [1509](https://github.com/i18next/react-i18next/pull/1509)
|
|
8
|
+
|
|
9
|
+
### 11.16.9
|
|
10
|
+
|
|
11
|
+
- types: fix missing generic type for HTMLAttributes [1499](https://github.com/i18next/react-i18next/pull/1499)
|
|
12
|
+
|
|
1
13
|
### 11.16.8
|
|
2
14
|
|
|
3
15
|
- types: fix Trans component to support react 18 types, by introducing allowObjectInHTMLChildren TS option [1492](https://github.com/i18next/react-i18next/pull/1492)
|
package/README.md
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
[](https://circleci.com/gh/i18next/react-i18next)
|
|
4
4
|
[](https://codeclimate.com/github/i18next/react-i18next)
|
|
5
5
|
[](https://coveralls.io/github/i18next/react-i18next)
|
|
6
|
-
[![Quality][quality-badge]
|
|
6
|
+
[![Quality][quality-badge]][quality-url]
|
|
7
|
+
[![npm][npm-dl-badge]][npm-url]
|
|
7
8
|
|
|
8
9
|
[npm-icon]: https://nodei.co/npm/react-i18next.png?downloads=true
|
|
9
10
|
[npm-url]: https://npmjs.org/package/react-i18next
|
|
10
|
-
[quality-badge]:
|
|
11
|
-
[quality-url]:
|
|
11
|
+
[quality-badge]: https://npm.packagequality.com/shield/react-i18next.svg
|
|
12
|
+
[quality-url]: https://packagequality.com/#?package=react-i18next
|
|
13
|
+
[npm-dl-badge]: https://img.shields.io/npm/dw/react-i18next
|
|
12
14
|
|
|
13
15
|
### IMPORTANT:
|
|
14
16
|
|
package/package.json
CHANGED
package/ts4.1/index.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true
|
|
|
103
103
|
? Record<string, unknown>
|
|
104
104
|
: never;
|
|
105
105
|
declare module 'react' {
|
|
106
|
-
interface HTMLAttributes {
|
|
106
|
+
interface HTMLAttributes<T> {
|
|
107
107
|
children?: ReactNode | ObjectOrNever;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -326,8 +326,11 @@ export function withSSR(): <Props>(
|
|
|
326
326
|
getInitialProps: (ctx: unknown) => Promise<any>;
|
|
327
327
|
};
|
|
328
328
|
|
|
329
|
-
export interface WithTranslation<
|
|
330
|
-
|
|
329
|
+
export interface WithTranslation<
|
|
330
|
+
N extends Namespace = DefaultNamespace,
|
|
331
|
+
TKPrefix extends KeyPrefix<N> = undefined
|
|
332
|
+
> {
|
|
333
|
+
t: TFunction<N, TKPrefix>;
|
|
331
334
|
i18n: i18n;
|
|
332
335
|
tReady: boolean;
|
|
333
336
|
}
|
|
@@ -337,10 +340,14 @@ export interface WithTranslationProps {
|
|
|
337
340
|
useSuspense?: boolean;
|
|
338
341
|
}
|
|
339
342
|
|
|
340
|
-
export function withTranslation<
|
|
343
|
+
export function withTranslation<
|
|
344
|
+
N extends Namespace = DefaultNamespace,
|
|
345
|
+
TKPrefix extends KeyPrefix<N> = undefined
|
|
346
|
+
>(
|
|
341
347
|
ns?: N,
|
|
342
348
|
options?: {
|
|
343
349
|
withRef?: boolean;
|
|
350
|
+
keyPrefix?: TKPrefix;
|
|
344
351
|
},
|
|
345
352
|
): <
|
|
346
353
|
C extends React.ComponentType<React.ComponentProps<any> & WithTranslationProps>,
|
|
@@ -361,9 +368,12 @@ export interface I18nextProviderProps {
|
|
|
361
368
|
export const I18nextProvider: React.FunctionComponent<I18nextProviderProps>;
|
|
362
369
|
export const I18nContext: React.Context<{ i18n: i18n }>;
|
|
363
370
|
|
|
364
|
-
export interface TranslationProps<
|
|
371
|
+
export interface TranslationProps<
|
|
372
|
+
N extends Namespace = DefaultNamespace,
|
|
373
|
+
TKPrefix extends KeyPrefix<N> = undefined
|
|
374
|
+
> {
|
|
365
375
|
children: (
|
|
366
|
-
t: TFunction<N>,
|
|
376
|
+
t: TFunction<N, TKPrefix>,
|
|
367
377
|
options: {
|
|
368
378
|
i18n: i18n;
|
|
369
379
|
lng: string;
|
|
@@ -373,8 +383,10 @@ export interface TranslationProps<N extends Namespace = DefaultNamespace> {
|
|
|
373
383
|
ns?: N;
|
|
374
384
|
i18n?: i18n;
|
|
375
385
|
useSuspense?: boolean;
|
|
386
|
+
keyPrefix?: TKPrefix;
|
|
376
387
|
}
|
|
377
388
|
|
|
378
|
-
export function Translation<
|
|
379
|
-
|
|
380
|
-
|
|
389
|
+
export function Translation<
|
|
390
|
+
N extends Namespace = DefaultNamespace,
|
|
391
|
+
TKPrefix extends KeyPrefix<N> = undefined
|
|
392
|
+
>(props: TranslationProps<N, TKPrefix>): any;
|