I use external library in react app and there are some actions that opens another pages.
When I click to button with url e.g "/dashboard/reviews" it goes to "/dashboard/reviews" in chrome correctly but in safari go back to last page.
External library uses code like this
onclick = (url) => { (history.pushState({}, "", url), history.pushState({}, "", window.location.href), history.back()) }
I left breakpoints and it is last raw of code before redirect
Question: Why this code below goes to page correctly in chrome but redirect to back in safari ? And what this code actually do ?
(history.pushState({}, "", url), history.pushState({}, "", window.location.href), history.back()