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

Update @types/react-tracking #172

Open
Sicria opened this issue Dec 13, 2020 · 4 comments
Open

Update @types/react-tracking #172

Sicria opened this issue Dec 13, 2020 · 4 comments

Comments

@Sicria
Copy link

Sicria commented Dec 13, 2020

Is it possible to update the types for the useTracking hook to allow for passing in an object.

@tizmagik
Copy link
Collaborator

tizmagik commented Jan 4, 2021

Yes, that'd be great. TypeScript types via DefinitelyTyped, @types/react-tracking, are a community-driven effort currently. Although we do have plans to rewrite the internals to TypeScript and thus export type definitions directly (see #152 for WIP or if you'd like to contribute)

Also as noted in #173 by @mattes3:

the typescript types are not up to date. They correspond to version 7. They are missing the property Track in the object that is returned by the useTracking() hook.

@trescenzi
Copy link

Hi all. I ran into an issue where, in TS, I couldn't pass a function as the first argument to useTracking and then in turn use the return value of that function in dispatch. I opened a PR(linked above) and I believe that it's accurate. Not 100% but I've already made the changes in my project's d.ts file and everything is working as expected. Let me know if there's anymore information you'd like or if there's more I could do here.

Thank you! Love the library.

@trescenzi
Copy link

trescenzi commented May 1, 2022

Just wanted to bump this. I've gotten approval from the definitivelytyped maintainers but will wait till the evening of 5/3, or someone here says otherwise, to merge it in case anyone from this repo has opinions on the change. I've got the changes locally running on a production site so I'm pretty certain it's safe, just want to make sure the owners of this repo don't have any issues with it.

@tizmagik
Copy link
Collaborator

tizmagik commented May 2, 2022

Those updates look good @trescenzi -- thanks so much for contributing. It's greatly apprecaited!

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