It modifies the browser history, so the URL won’t change, but the “location” object will, since it’s internal state got updated

As in the article, if you do const location = useLocation() in a component, this component *should* re-render since the browser location object has changed.

If this doesn’t happen, make sure you follow the setup instructions correctly by passing tthe same history object to both your <Router> component and your routerMiddleware .




Front-end ReactJS Developer —

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store