Is there a way to programmatically add to the browser history stack such that next router will navigate to the newly added path on router.back()
?
I have tried window.history.pushState({}, '', "/my_new_route")
but it is not working correctly with next router. router.back()
won't do anything on the first call. On the second call, it will then navigate to the route on the history stack previous to the custom added one, as expected.