I am using the Router from next/router in order to have a dynamic URL and load different content on the page:
Router.push('/contract', `/contract/${id}`);
The issue is the back button doesn't function as expected afterward.
After the push function is run the first click of the back button does not update the URL, but does load the previous contract content.
The 2nd click of the browser back button does update the URL and the page content remains the same (which is now correct relative to the URL)
Extra Note: There is a breadcrumb back button that runs the window.history.back() function that works in this same unexpected manner (which makes sense).
Is the back button a known issue when using the push method of the Router, or dynamic URLs in general? Is there a way to work around that with Javascript?