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

Parameterized use of TFunction fails while WithT use works #1188

Merged
merged 5 commits into from
Jan 23, 2019

Conversation

rosskevin
Copy link
Collaborator

@rosskevin rosskevin commented Jan 23, 2019

Closes #1187

@rosskevin rosskevin self-assigned this Jan 23, 2019
@rosskevin
Copy link
Collaborator Author

I'm stumped so far. Any thoughts @tkow @VincentLanglet ?

@rosskevin
Copy link
Collaborator Author

Got it! Still strange I cannot use an externalized version of WithT['t'] as TFunction. It appears TFunction must be a type instead of interface to get everything to play nice with generics.

@rosskevin
Copy link
Collaborator Author

I guess I'm not quite there yet...so close.

@rosskevin
Copy link
Collaborator Author

Ok, finally got it. It appears with typescript strict that undefined must be part of the result otherwise usage in option args/props gets too unwieldy.

@rosskevin rosskevin merged commit aeb1554 into i18next:master Jan 23, 2019
@rosskevin rosskevin deleted the ts-tfunction-parameterized-usage branch January 23, 2019 23:38
@rosskevin
Copy link
Collaborator Author

@jamuhl this is a patch release. Please ping me on gitter or twitter and I'll make sure i18next/react-i18next#694 builds - it needs released asap.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.155% when pulling d3949ed on rosskevin:ts-tfunction-parameterized-usage into e0fa366 on i18next:master.

@jamuhl
Copy link
Member

jamuhl commented Jan 24, 2019

@rosskevin just published i18next@14.0.1

@VincentLanglet
Copy link
Contributor

@rosskevin Seems like you found a solution. Good job

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.

4 participants