I'm relatively new to Typescript and React.
Following tutorials, I'm trying to add withRouter
from "react-router-dom"
, but I'm getting an error saying Module '"react-router-dom"' has no exported member 'withRouter'.
There is no reference to withRouter
anywhere in the react-router-dom node-modules package. This is confusing to me and I don't know if typescript is the origin of the missing function. I know they have removed some functionality but I can't find anything that could replace it, in order to access this.props.history.push()
from inside my component.
Can anyone advise on this? What am I doing wrong?