Why the reassembling of the application to React?

The application uses NEXT.JS for the front, SSR on EXPRESS.JS. All references made in such a way that the app when you click on it does not restart (as it should be in reacte). But I noticed that when I click the forward and back buttons of the browser is rebuilding the app again. Why is this happening and how to fix it?

P. S. Added to the file pages/_app.js this code (on the advice of English-speaking forums):
componentDidMount() {
 Router.beforePopState(({as}) => {
 location.href = as;
});

 };


But it didn't help.
March 23rd 20 at 18:54
0 answer

Find more questions by tags Server-Side RenderingReactExpress.js