Closed joepio closed 1 year ago
The reason this happens is because the full list of items of infiniteHits is stored inside infiniteHits itself, not somewhere global, meaning that geo search doesn't have access to that.
A workaround could be to use useGeoSearch for the boundaries etc, but still use useInfiniteHits for displaying the hits on the map, as you can still access _geoLoc.
Would that work for your use case?
That's a great idea! Works perfectly :)
🐛 Current behavior
I'm using
react-instantsearch-hooks-web
to render both a map andInifiteHits
. This combination leads to weird behavior: when clicking theShow more results
button, the first page results disappear from the map.I'm not entirely sure if this could be classified as a bug, but the behavior is definitely confusing to users.
🔍 Steps to reproduce
useGeoSearch
connector for a map (docs)InfiniteHits
component.show more results
Live reproduction
no
💭 Expected behavior
the
items
fromuseGeoSearch
(=useConnector
) should return all items from currently shown list inInifiniteHits
Package version
"react-instantsearch-hooks-web": "6.38.3"
Operating system
macOS m1
Browser
Chrmoe
Code of Conduct