Skip to content
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

TypeScript Error TS2558 after upgrade to v23: Expected 3-4 type arguments, but got 1 #2029

Closed
adrianui5 opened this issue Sep 6, 2023 · 6 comments

Comments

@adrianui5
Copy link

Hello,

I was using this implementation of i18next for my react components:
this.props.t!("test_page.area")

Now after upgrading to version 23.0.0, I am facing this issue:
Type 'TOpt["returnObjects"] extends true ? $SpecialObject : string' is not assignable to type 'ReactI18NextChildren'.
Type 'string | $SpecialObject' is not assignable to type 'ReactI18NextChildren'.
Type 'object' is not assignable to type 'ReactI18NextChildren'.
Type 'TOpt["returnObjects"] extends true ? $SpecialObject : string' is not assignable to type 'ReactPortal'.ts(2322)
index.d.ts(47, 5): The expected type comes from property 'children' which is declared here on type 'DetailedHTMLProps<TdHTMLAttributes, HTMLTableDataCellElement>'
Expected 3-4 type arguments, but got 1.ts(2558)

When removing the , I am ending up with an eslint issue:
Forbidden non-null assertion

Now I am asking myself, how do I need to change my coding to meet the new syntax requirements?

Thanks,
Adrian

@adrai
Copy link
Member

adrai commented Sep 6, 2023

Make sure you updated not only i18next but also react-i18next.
Please provide a minimal reproducible example repository or codsandbox example or similar.

@adrianui5
Copy link
Author

HI @adrai,

EDIT: The codeline in my pervious message was incorrect, I am actually using this implementation:
this.props.t!("test_page.area")

I have upgraded the following packages:
"i18next": "^23.4.6",
"i18next-browser-languagedetector": "^7.1.0",
"react-i18next": "^13.2.2",

The issue is still remaining. Before creating codesandbox, would I need to add more configurations to the i18n,js file?

@adrai
Copy link
Member

adrai commented Sep 6, 2023

Before creating codesandbox, would I need to add more configurations to the i18n,js file?

I don't think so.

@stale
Copy link

stale bot commented Sep 17, 2023

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.

@stale stale bot added the stale label Sep 17, 2023
@adrai adrai removed the stale label Sep 17, 2023
@pedrodurek
Copy link
Member

@adrianui5, Could you share a reproducible example?

Copy link

stale bot commented Dec 15, 2023

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.

@stale stale bot added the stale label Dec 15, 2023
@adrai adrai closed this as completed Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants