Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

261
Views
How to Implement Infinite Scrolling with Infinite Data in React?

I need to implement infinite scrolling in a react app, while my data is huge and the use might keep on scrolling and scrolling for a long time.

All the infinite scrolling solutions that I've found only handle adding the data to the table whole scrolling. But I need to also remove data from the DOM to prevent the app from slowing due to tens of thousands of rows being potentially loaded after some time on the app (think social media feed). I also don't want to keep all the data in the memory and I need to clean old data while scrolling (up and down).

So basically what I need to do:

  1. Load the first 100 rows (1 page) to the page
  2. When the user scrolls down and getting near the bottom, load next page and add to the bottom
  3. When the page has a large amount of pages (lets say 5 page, or 500 rows) start to remove old pages from the top when the user keeps scrolling down
  4. If the user start scrolling up, we need to reverse the functionality - Request the pages we removed again and add them to their place in the top

Does anyone know of such a solution? Any recommendations on how to tackle this if I need to build from scratch?

Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

1. Use react-infinite-scroll-component.
Follow instructions in documentation.
You can see basic example here. Here initially array have 20 elements and fetchMoreData function concatinate 20 more elements to it.
Basically you are concatinating, next elements in in array and adding them over, this is the concept of infinite-scroll. For furthur references, link1, link2.
Or
2. You can implement you custom scrolling as well, like this

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!