-
-
Notifications
You must be signed in to change notification settings - Fork 642
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TFunction types, doesn't infer nested interpolation correctly #2014
Comments
Probably we need some flatting of the passed interpolation object somewhere here: https://github.com/i18next/i18next/blob/master/typescript/t.d.ts#L133 |
feel free to try a PR... else we need to wait for @pedrodurek to have a look at it |
@reckter can you double check with the latest version? Right now it's 23.4.4 Yesterday I forked your example to make some tests for #2016 and today I noticed it didn't show any TS error when upgrading its dependencies. |
@giovannipiller I still have the same issue in my project. (originaly with I forked your sandbox again (fork-caption), and it seems it doesn't show errors at all even if I supply completely the wrong object altogether: https://codesandbox.io/s/react-i18next-typescript-code-sandbox-forked-ktvtd3?file=/src/App.tsx |
I had a quick look at the changes in But without knowing the ins and outs of that section, it's just a guess. Maybe that helps :) |
@pedrodurek possible? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'll look into it this week |
any updates on this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@marcalexiei do you have an idea why this behaves like that? |
Lines 137 to 146 in 2f3384b
E.g.: To solve the issue the code of I can try to setup a PR to fix this issue in the upcoming days |
Do you think this will slow down the performance a lot? |
I don't think so, but I'll try to make some test
Yes, I'll try to do it in the upcoming days |
should be addressed with v23.9.0 |
🐛 Bug Report
The TFunction types, do not correctly allow nested interpolation objects.
Example
will not work, it will produce the error:
but with
it will work.
To Reproduce
Codesandbox, with the code above: https://codesandbox.io/s/react-i18next-typescript-code-sandbox-forked-gg6x7q?file=/src/App.tsx
The text was updated successfully, but these errors were encountered: