Closed Viniter closed 5 years ago
Correction: history
doesn't actually provide TS definitions, it's provided by DefinitelyTyped (@types/history
). It would have to be added as a dependency in order to be used.
Alternatively, the current definition can be updated to match the @types/history
one. I can open PR with either one of the fixes. Just tell me which one would you prefer.
EDIT: After looking into it for a bit, the difference between definitions is actually pretty slight, the only thing that needs fixing is the Action
type the interface uses. I'll open a PR that fixes it, but you still might consider adding the type dependency, to save yourself the trouble.
Thanks @Viniter! Appreciate you taking the time to look into those definitions. Just reviewed your PR, testing locally now. Apologies for the late response, we have only so many hands on OSS at once!
Fixed by #289.
The TypeScript definitions contain a definition of History interface that's not compatible with the one provided by
history
library.https://github.com/FormidableLabs/redux-little-router/blob/57a15dbcd88daa95af8f5ad5677e691583b7e5ff/index.d.ts#L126
This causes a typing issue when for example trying to pass custom history to
routerForBrowser()
. You could instead import the interface fromhistory
and ditch the above mentioned definition.