Whenever the user clicks on the continue button, a function is fired and in that function, I call:
push("/signup/page-2", undefined, { shallow: true });
All dynamic routes that looks like /signup/[page].js that returns <Component />
I also have a /signup/index.js that returns <Component />
The Problem is:
The page reloads and all state is cleared each time push("/signup/page-2", undefined, { shallow: true }); is called.
It's also worth mentioning that this app was a CRA with react-router-dom app that was converted to a next.js app