Shazam Shakeel
07/11/2024, 10:31 AM<InstantSearchSSRProvider {...serverState}>
<InstantSearch
indexName={indexName}
searchClient={searchClient}
future={{ preserveSharedStateOnUnmount: false }}
// Synchronizing the UI state and the URL
routing={{
router: createInstantSearchRouterNext({
singletonRouter,
serverUrl,
routerOptions: {
cleanUrlOnDispose: false,
createURL: ({ qsModule, routeState, location }) =>
createURL({
qsModule,
routeState,
location,
isShopPage: true,
}),
parseURL: ({ qsModule, location }) =>
parseURL({ qsModule, location, isShopPage: true }),
},
}),
stateMapping: {
routeToState: routeToState,
stateToRoute: stateToRoute,
},
}}
>
<VirtualFilters />
{/* UI components /*}
</InstantSearch>
</InstantSearchSSRProvider>