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

Fix type 'TFunctionResult' is not assignable to type 'ReactNode' on React 18 #1480

Merged
merged 1 commit into from Apr 10, 2022
Merged

Fix type 'TFunctionResult' is not assignable to type 'ReactNode' on React 18 #1480

merged 1 commit into from Apr 10, 2022

Conversation

akunzai
Copy link
Contributor

@akunzai akunzai commented Apr 10, 2022

Fixes #1476 by add ReactNode to the TDefaultResult type

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included

@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.078% when pulling 7a458db on akunzai:reactnode-not-assignable into 41ff4be on i18next:master.

@pedrodurek
Copy link
Member

Hey @akunzai, the ReactNode should be applied on the i18next lib, so we can fix on both libs. https://github.com/i18next/i18next/blob/master/index.d.ts#L685

Thanks for taking the initiative!

@akunzai
Copy link
Contributor Author

akunzai commented Apr 10, 2022

Hi @pedrodurek, thanks for the advice,
But the i18next has no direct dependency on the React,
I don't think we can apply the fix in the i18next repo easily.

@sergioUjo
Copy link

sergioUjo commented Apr 10, 2022

when will this be available to use?

Thank you

@adrai
Copy link
Member

adrai commented Apr 10, 2022

As soon as @pedrodurek approves it

@adrai adrai merged commit be65eea into i18next:master Apr 10, 2022
@adrai
Copy link
Member

adrai commented Apr 10, 2022

v11.16.4 has just been released

@sergioUjo
Copy link

God dam that was quick, :)

@adrai
Copy link
Member

adrai commented Apr 10, 2022

Thanks to @akunzai for the contribution and @pedrodurek for the review.

If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project.

There are many ways to help this project 🙏

@akunzai akunzai deleted the reactnode-not-assignable branch April 10, 2022 16:27
adrai pushed a commit that referenced this pull request Apr 10, 2022
ReactNode was incorrectly added in the #1480 without React prefix - breaks tsc compilation, unless skipLibCheck is set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type 'TFunctionResult' is not assignable to type 'ReactNode' on React 18
5 participants