Routing=true parameter malfunctioning on direct navigation to filtered page

Hey everyone! I’m building an app that uses Algolia to search through items. I’m using react-instantsearch-hooks to power my search engine, using the routing property to use the default provided router to sync the search state with the current URL.

<InstantSearch searchClient={searchClient} routing={true}>

This works fine within a browsing session, when the URL starts with the base URL / and more parameters (i.e., query=___) are added. However, when I open up a new browser tab and directly go to the URL, then in about 1 second, as soon as the results load in, the URL is reverted to / and the filters are lost.

Any thoughts on how I can fix this? I’m using NextJS and client-side rendering, if it’s relevant.

Thank you!

Hi @vgsoham

I haven’t seen this behavior before. Are you using the built in routers or are you mapping state info yourself using stateToRoute and routeToState?

It would help to see more of your code.