Using createInstantSearchRouterNext and the URL Changes then Reverts Back Resetting Everything

I really hope someone can help me as I’ve been banging my head against this for some time now.

I have a NextJs 13 website that I have integrated Algolia instansearch into. I can get everything working correctly - refinements, search, pagination, sorting (refinements and sorting using custom components).

As this is an ecommerce site I need to remember the state (and scroll position) of the collection pages when the user clicks through to a product and then clicks back.

I’ve implemented “createInstantSearchRouterNext” but every time I interact with a refinement, sort or pagination - the URL soft navigates to the correct Algolia URL, flashes the correct results, then reverts back to the initial state.

I’ve tried countless things, but nothing is working.

Any help on this would be really appreciated.

Hi, did you manage to solve this? Got the same problem

Hi, yes I did solve this by tracing it back using the profiler. It turned out it was a prop on the element in _app.js that was changing with every URL change, hence the changing of content and reverting back.

Hope this helps.