elgorditosalsero / react-gtm-hook

Easily manage the Google Tag Manager via Hook
https://elgorditosalsero-react-gtm-hook.netlify.app/
MIT License
220 stars 28 forks source link

typescript error when upgrading to version v2.7.1 #79

Closed TheWalkingDad3 closed 1 year ago

TheWalkingDad3 commented 1 year ago

Disclaimer: this is my first issue report so I hope I can provide you the information that is needed ...

After the upgrade to version 2.7.1 I got an error when building my typescript application.

Type error: Argument of type '{ event: string; value: string; }' is not assignable to parameter of type 'ISendToGTM'. Object literal may only specify known properties, and 'event' does not exist in type 'ISendToGTM'.

even if I use the demo-code it is not working: const sendDataToGTM = useGTMDispatch(); sendDataToGTM({ event: 'awesomeButtonClicked', value: 'imAwesome' });

thank you very much, Tobias

elgorditosalsero commented 1 year ago

Hi @TheWalkingDad3, it should be fixed now with the 2.7.2 release, feel free to re-open if not working.

TheWalkingDad3 commented 1 year ago

works now perfect, thank you very much for your help :)