Skip to content

How can I disable connection of pagination widget to routing? #5044

Answered by Haroenv
mixvar asked this question in Q&A
Discussion options

You must be logged in to vote

This possibly seems like a bug in the history router, where here:

https://github.com/algolia/instantsearch.js/blob/master/src/lib/routers/history.ts#L151

it doesn't check whether the existing URL is already the one it is going to push towards. Unfortunately the easiest way for you would be to lightly fork and modify the router to this:

code for the previous fix
import qs from 'qs';
import type { Router, UiState } from 'instantsearch.js';
import { safelyRunOnBrowser } from 'instantsearch.js/es/lib/utils/safelyRunOnBrowser';

type CreateURL<TRouteState> = (args: {
  qsModule: typeof qs;
  routeState: TRouteState;
  location: Location;
}) => string;

type ParseURL<TRouteState> = (args: {
  q…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Haroenv
Comment options

@mixvar
Comment options

@Haroenv
Comment options

Answer selected by mixvar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Library: InstantSearch.js Issues in instantsearch.js
2 participants