Next.js clearing fliters on route change

Hi!

Im having some issues with my Next.js application and route changing.

I am using React Instantsearch and all working great except my dynamic pages.

If you are on a category page (e.g. Audio) and apply a filter this works fine however upon changing to a new dynamic page the filter is still being applied.

Is it possible to clear the refinement upon dynamic route change?

I have created a sandbox at the link below:
https://codesandbox.io/s/dawn-shape-oku9e

Hi Scott,

It looks like your search state is never reinitialized when changing page in your application.
This way, your new page will get the old page search state.
I’m not very familiar with next.js, but there should be a way to hook on the route change and reset your search state at this point ?

Emmanuel