algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.7k stars 518 forks source link

Duplicate elements using InfiniteScroll + HitsPerPage #1839

Closed Kikobeats closed 7 years ago

Kikobeats commented 7 years ago

It appears in the last page. Looks like duplicate all the elements of the last page?

I checked the content directly in the index and just is a duplicate on the frontend level

windtoday__intelligent_windsurf_marketplace
mthuret commented 7 years ago

Hi @Kikobeats,

I saw that you have implemented your own InfiniteHits connector. What were the reasons of not using the one we provide? See: https://community.algolia.com/instantsearch.js/react/connectors/connectInfiniteHits.html

Kikobeats commented 7 years ago

Oh, I reimplemented the connector becuase I need to pass extra props, but basically is the same (I checked it before create the issue).

You can see the implementation here: https://github.com/windtoday/windtoday-marketplace/blob/master/src/app/Results/connector.js

mthuret commented 7 years ago

I look with our infinite example and wasn't able to reproduce the behavior you observed.

Could you try to use directly the InfiniteHits connector directly under the <InstantSearch/> component just to see if you observe the same thing?

Also what do you mean by including the HitsPerPage in the title?

Kikobeats commented 7 years ago

It started working fine when I removed hitsPerPage prop from InstantSearch component. You can see it here: https://github.com/windtoday/windtoday-marketplace/commit/74d6caaa81d36297dd70f12680faa3996692c4e7

mthuret commented 7 years ago

I wasn't able to reproduce it using InfiniteHits + hitsPerPage setup with searchParameters.

Can you try using directly InfiniteHits, even just the widget with raw values, just to see if you can observe the same behavior? Thanks @Kikobeats!

Kikobeats commented 7 years ago

sure, give me a little time try to be ensure with that 😄