-
Hi, I'm not sure if this is a bug, or just lack of understanding on my part, so I posting as a question here with a codesandbox demo. I'm trying to build my own infinite scroll component with useInfiniteHits hook. While showMore works as intended (page number increases from 1 to 2 to 3, .. etc) i noticed that showPrevious always starts from -1 and not from the 'currentPage' that i was on . I wish to use showPrevious like this: if i press showMore 2 times, page number becomes from 1 to 3, and i press showPrevious. I would expect showPrevious submit a request to algolia with page number. = 2 but instead it's -1. So, hopefully someone can guide me on how I can use showPrevious with this scenario. you can refer to this codesandbox for details: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The goal of showPrevious is to show the "most previous page that isn't already shown". So if you're using showPrevious, it would be more a situation like this:
The |
Beta Was this translation helpful? Give feedback.
The goal of showPrevious is to show the "most previous page that isn't already shown". So if you're using showPrevious, it would be more a situation like this:
The
showPrevious
method and button shouldn't be called whenisFirstPage
is true