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

Add typescript tests for v10 hooks (like we had in v9) #703

Closed
jamuhl opened this issue Jan 30, 2019 · 5 comments
Closed

Add typescript tests for v10 hooks (like we had in v9) #703

jamuhl opened this issue Jan 30, 2019 · 5 comments
Assignees

Comments

@jamuhl
Copy link
Member

jamuhl commented Jan 30, 2019

Get back the test coverage for the upcoming v10 (currently (soon) it is published as npm i react-i18next@next)

@jamuhl
Copy link
Member Author

jamuhl commented Jan 30, 2019

@rosskevin would be awesome if we could add that coverage back in v10 - a lot changed with using hooks but basic type definitions should already be there

@rosskevin
Copy link
Collaborator

rosskevin commented Jan 30, 2019

@jamuhl it looks like you dropped NamespaceConsumer from v10 but the hoc is retained. That's too hard of a break in my opinion for class-based users. I for one am exclusively using it over the hoc, and we have many classes to convert before we can use hooks.

If leaving this as-is I would have two choices:

  1. convert my entire class code to functions and hooks (not incremental)
  2. convert my entire function code to hooks AND convert all NamespaceConsumer usage to hocs or functions and hooks.

I suggest strongly that the NamespaceConsumer render callback needs to be included in v10 (perhaps deprecated).

@rosskevin
Copy link
Collaborator

rosskevin commented Jan 30, 2019

@jamuhl would you have any objections to converting the spec.js to spec.tsx typescript? This would inherently provide basic coverage for the type definitions.

@jamuhl
Copy link
Member Author

jamuhl commented Jan 30, 2019

@rosskevin ...would prefer keeping stuff separated...

hm...might add a render prop like the HOC using the hook internally

@rosskevin
Copy link
Collaborator

hm...might add a render prop like the HOC using the hook internally

That would definitely be advisable, it would be mostly a search/replace instead of a major upgrade crisis where everyone is forced to roll their own.

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

2 participants