joernroeder / piwik-react-router

Piwik analytics component for react-router
https://www.npmjs.org/package/piwik-react-router
MIT License
61 stars 22 forks source link

connectToHistory typescript definition does not accept same arguments as the function. #63

Open emerencia opened 2 years ago

emerencia commented 2 years ago

The exported typescript definition reads:

connectToHistory<H extends LooseHistory>(history: H): H;

But in react-router-piwik.js the function is defined as:

connectToHistory(history, trackAtConnect, callback)

I can supply those extra arguments and it works, but my IDE complains about a typescript mismatch:

2021-10-29_00-49-36

I think at some point the function got extra arguments and someone forgot to update the typescript exported definition?

I even think that if you call it with just one argument, it errors, because it tries to call that callback function (third argument).