Commit 7459a36
authored
feat: use const type parameters for useTranslation() (#1842)
TypeScript 5.0 has introduced const type parameters [1]. These indicate
that a more specific type is preferred over a more general one. As
a result, the resulting UseTranslationResponse will be more precise
and retain the passed-in namespace and prefix. This can be used by
extractors and other tooling to find out exactly which key is
accessed by a translation function call.
[1]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters1 parent 1d6fef3 commit 7459a36
2 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
| |||
0 commit comments