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 hooks stub types #650

Merged
merged 1 commit into from
Dec 27, 2018
Merged

Add hooks stub types #650

merged 1 commit into from
Dec 27, 2018

Conversation

jleclanche
Copy link
Contributor

Touches #591

They're far from complete but better than nothing.
I had a lot of trouble with the code as there's a bunch of type issues throughout it. I would highly recommend moving the project to typescript, it'd be cleaner and easier… :)

@jleclanche jleclanche mentioned this pull request Dec 27, 2018
7 tasks
@coveralls
Copy link

Coverage Status

Coverage remained the same at 74.448% when pulling 478020e on jleclanche:master into 503d9e1 on i18next:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 74.448% when pulling 478020e on jleclanche:master into 503d9e1 on i18next:master.

@jamuhl jamuhl merged commit eb678f7 into i18next:master Dec 27, 2018
@jamuhl
Copy link
Member

jamuhl commented Dec 27, 2018

thank you for the initial version for hook typings

@mondayCoding
Copy link

Not sure if relevant but I tweaked index path locally in node_modules to find typings.
Thank you for these, I was waiting for types to get to testing.

3 | import {Namespace, ReactI18NextOptions, TransProps} from "./index";

=>

3 | import {Namespace, ReactI18NextOptions, TransProps} from "./src/index";

@stunaz
Copy link

stunaz commented Jan 5, 2019

@jleclanche how are we suppose to use the hooks in typescript?
when I do const [t, i18n] = useTranslation();

later i want to get the current language with i18n.language

I get this typing error:

Type error: Property 'language' does not exist on type '{} | on type '{} | i18n'.
  Property 'language' does not exist on type '{}'.  TS2339{}'.  TS2339

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants