Hi @aleksandra_budnik
Thank you for your reply. I think it’s a bit hard to provide a demo but I will try to explain it clearly as I could.
This part of the app we’re building is the Persons section. We use GraphQL for talking to the database.
- On first load, we set perPage to a 100, meaning we only show about 100 persons to the user
- So when the user scrolls down to about 99th row, we show a loading bar (mimicking infinite scroll), then we trigger another call to fetch an additional 100, so that makes 200 all in all
- After we receive that another 100, we then push that new 100 to the end of the dataHolder that is holding the first 100 on first load. That dataHolder is what I feed on the HandsOnTable data props.
Currently, our setup for pagination in graphql is per page.
My concern is that every time we add another set of 100 to the dataHolder, the HandsOnTable seems getting slower and slower. Especially if the dataHolder is holding about 500 persons. I mean, every time we change the state, fetch and add another 100, the table is getting slower in rendering. Is there a way to make it faster? Or another smart way of implementing it? I might be implementing it all wrong.
Thank you for the time.