I have a custom Hits component with connectHits, a ClearAll button and a Pagination component.
I’m trying to replace the pagination with an infinite scroll, by using a Waypoint (react-waypoint) component and connectInfiniteHits instead of connectHits.
The custom Hits component displays the results and the Waypoint component at the end, so when the user scrolls to it, a function is called that in turn calls the refine() function provided (without passing any parameters) to the custom Hits component.
The problems I’m experiencing right now:
- I have to scroll to the waypoint once, then scroll back, then again so the second page of results loads.
- Once I loaded a new page of results, when I click on the ClearAll button, the page gets reset to -1, so I get a 400 bad request result from algolia.
Am I doing something wrong? I’m not changing the page by myself at any point, and I’m using a ClearAll component without anything else.
I’m using react-instantsearch 3.2.0