I'm making an infinite scroll with react router and not sure got it should be implemented. I receive initial data from loader, then since it's not reactive, I use useState and set its state with initial data.
Then when using infinite scrolling there's fetcher which receives data into fetcher.data.
And finally useEffect in which state get replenished with new items after fetcher.data changes
When scrolling, I receive new data in batches like ?page=2, /?page=3
isn't it a bit convoluted? Is there a simpler way?