react-router/history.d.ts.We have history/history.d.ts. Why isn't react-router using this?
This file was added by #6073, but history/history.d.ts predates that PR. I don't see a reason why it was duplicated.
Can we get rid of react-router/history.d.ts? Unfortunately the two files seem to have diverged, so this won't be easy. But they reference the same project, and have the same authors listed.
I'm not the author but this seems sensible. As an aside react-router will be undergoing big changes with regards history anyway; see here: https://github.com/ReactTraining/react-router/issues/3611#issuecomment-246739152
How can you install react-router/history via npm in TS 2.0? It used to be:
typings install react-router/history
but
npm install @types/react-router/history
is not a valid module name.
Thanks!
@remojansen You can't install the version of history that exists inside of react-router, hence this issue. Hopefully you can install @types/history and it will work.
This version of history is missing the type for hash on the Location type.
Most helpful comment
@remojansen You can't install the version of
historythat exists inside ofreact-router, hence this issue. Hopefully you can install@types/historyand it will work.