New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
The keyPrefix
options is not resolved correctly as of 23.7.14
#2103
Comments
No, it won't fix this issue. I'm looking into it 馃 |
@marcalexiei maybe you have an idea on why this happens? |
What is really strange is, this works: const prefixedT = i18next.getFixedT('en', 'translations', 'deep')
prefixedT('deep.deep');
// @ts-expect-error
prefixedT('morning'); There's only a problem in combination with useTranslation from react-i18next |
v23.7.15 should fix this |
Wow, you're super quick with merging my contributions :D Yeah, I'm not entirely sure why the typing of I'm also not entirely sure why my fix fixed the issue. Potentially the type resolution just... stopped? As I understand it, the type @pvdstel, let me know if this is actually fixed for you now or if I missed something about your use case. |
It seems to be working fine now. Thank you all for the fast response! 馃槃 |
馃挜 Regression Report
The
keyPrefix
option inreact-i18next
is not recognized correctly. This is caused byi18next
itself though, not the React package.The line
is resolved to type
TFunction<"translations", "deep">
in23.7.13
and earlier, but resolves toTFunction<"translations", KeyPrefix<"translations">>
now.Last working version
Worked up to version: 23.7.13.
Stopped working in version: 23.7.14.
To Reproduce
I've added this zip file containing a repository which reproduces the issue. It only has the TypeScript, i18next, and
@types/react
dependencies. The package manager is pnpm. Runtype-check
to see the issue. Line 20 inindex.ts
should be producing an error.repro.zip
The relevant section is reproduced here:
Expected behavior
The type error should not be occurring.
Your Environment
The text was updated successfully, but these errors were encountered: