Infinite-scroll not working in controlled mode?

Hi *,

I’m currently trying to implement infinite-scrolling by using connectInfiniteHits and wondered why my hits just get replaced instead of being appended.

Now I narrowed this issue down to using <InstantSearch /> in a controlled manner to do some url-syncing.

When I cut the external state everything works as expected.

You can replicate this by just using a plain useState, so the problem doesn’t seem being caused by my own implementation.

So this:

const [state, setState] = useState({});

return <InstantSearch [...] searchState={state} onSearchStateChange={setState}>
   [...]
</InstantSearch>

breaks infinite scrolling instantly for me.

Any hints on this? :slight_smile:

Oh, I have to revise that!

After all, problem wasn’t caused by pulling out the state, but by the filters prop passed to <Configure /> which unfortunately changed on every render.