Closed tomcanac closed 3 years ago
Try using Rect Router's replaceState
function, not the one on the window, otherwise React Router doesn't know the url has changed. If you provide an isActive
prop it is passed through to React Router's <NavLink>
, so see the React Router docs (you should be able to pass in a boolean).
good, thanks for the information! Indeed it does work with importing the history object from my main app.
Thanks for the help!
Hi,
I managed to use window.history.replaceState to push anchors to the URL at scroll on my app page. It works well, but my URL update doesn't change the current isActive anchor button.
Any help on how to sync the isActive property with self updated URL hash would be amazing, thanks for the library, it helps a lot!