-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InstantSearchNext: URL rewritten #6131
Comments
Hi, Because InstantSearch takes over the URL when routing is enabled to store its search state in it, it doesn't allow unrelated query parameters within it by default. If you want to keep them, you need to explicitly include them by overriding the <InstantSearchNext
/* ... */
routing={{
router: {
createURL({ qsModule, location, routeState }) {
const { origin, pathname, hash } = location;
const queryString = qsModule.stringify({
...routeState,
// your own query parameters
test: true,
});
return `${origin}${pathname}?${queryString}${hash}`;
},
}
}}
>
/* ... */
</InstantSearchNext> |
Environment:
Actual
We are encountering a compatibility issue with the react-instantsearch-nextjs experimental package.
I had the below warning in the console.
Which I removed by setting the cleanUrlOnDispose=false.
I try to follow the steps in the docs link that is shared in this log message here.
However, I don't seem to be able to pass the history object or
next/router
singleton object (deprecated?) in the experimental package's routing prop that is required when passing a cleanUrlOnDispose argument.What I have done
My current set up is as follow. My component is nested within a client component so I'm not on the server side.
The warning is gone. By anywhere the component is loaded, my URL is going to be rewritten if it contains parameters that are not known by Algolia (eg
test=true
).Could you shed some light?
The text was updated successfully, but these errors were encountered: