react-i18next 17.0.1 → 17.0.2

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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## 17.0.2
2
+
3
+ - fix(types): `values` prop on `<Trans />` now only requires interpolation variables for the specific `i18nKey`, not all variables in the namespace [1913](https://github.com/i18next/react-i18next/issues/1913)
4
+
1
5
  ## 17.0.1
2
6
 
3
7
  - chore: bump minimum i18next peer dependency to `>= 26.0.1` _(forgot to do it in last version)_
@@ -32,6 +32,7 @@ export type TransProps<
32
32
  KPrefix = undefined,
33
33
  TContext extends string | undefined = undefined,
34
34
  TOpt extends TOptions & { context?: TContext } = { context: TContext },
35
+ Ret = TFunctionReturn<Ns, _AppendKeyPrefix<Key, KPrefix>, TOpt>,
35
36
  E = React.HTMLProps<HTMLDivElement>,
36
37
  > = E & {
37
38
  children?: TransChild | readonly TransChild[];
@@ -44,21 +45,26 @@ export type TransProps<
44
45
  ns?: Ns;
45
46
  parent?: string | React.ComponentType<any> | null; // used in React.createElement if not null
46
47
  tOptions?: TOpt;
47
- values?: InterpolationMap<TFunctionReturn<Ns, _AppendKeyPrefix<Key, KPrefix>, TOpt>>;
48
+ values?: InterpolationMap<Ret>;
48
49
  shouldUnescape?: boolean;
49
50
  t?: TFunction<Ns, KPrefix>;
50
51
  };
51
52
 
52
53
  export interface TransLegacy {
53
54
  <
54
- Key extends ParseKeys<Ns, TOpt, KPrefix>,
55
+ const Key extends ParseKeys<Ns, TOpt, KPrefix>,
55
56
  Ns extends Namespace = _DefaultNamespace,
56
57
  KPrefix = undefined,
57
58
  TContext extends string | undefined = undefined,
58
59
  TOpt extends TOptions & { context?: TContext } = { context: TContext },
60
+ Ret extends TFunctionReturn<Ns, _AppendKeyPrefix<Key, KPrefix>, TOpt> = TFunctionReturn<
61
+ Ns,
62
+ _AppendKeyPrefix<Key, KPrefix>,
63
+ TOpt
64
+ >,
59
65
  E = React.HTMLProps<HTMLDivElement>,
60
66
  >(
61
- props: TransProps<Key, Ns, KPrefix, TContext, TOpt, E>,
67
+ props: TransProps<Key, Ns, KPrefix, TContext, TOpt, Ret, E>,
62
68
  ): React.ReactElement;
63
69
  }
64
70
 
@@ -1 +1 @@
1
- {"type":"module","version":"17.0.1"}
1
+ {"type":"module","version":"17.0.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-i18next",
3
- "version": "17.0.1",
3
+ "version": "17.0.2",
4
4
  "description": "Internationalization for react done right. Using the i18next i18n ecosystem.",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "types": "./index.d.mts",
@@ -127,7 +127,7 @@
127
127
  "eslint-plugin-testing-library": "^6.5.0",
128
128
  "happy-dom": "^20.8.9",
129
129
  "husky": "^9.1.7",
130
- "i18next": "^26.0.1",
130
+ "i18next": "^26.0.3",
131
131
  "lint-staged": "^16.4.0",
132
132
  "mkdirp": "^3.0.1",
133
133
  "prettier": "^3.8.1",