Open Sicria opened 3 years ago
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.
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.
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.
Those updates look good @trescenzi -- thanks so much for contributing. It's greatly apprecaited!
Is it possible to update the types for the
useTracking
hook to allow for passing in an object.