I’m working on a project where I need to implement infinite scrolling in an Ant Design Table component for displaying large datasets. I’m fetching the data from a Laravel backend, and I want to implement lazy loading to avoid fetching all the data at once. However, I’m having trouble getting the table to load more data as the user scrolls down.
My Setup: Frontend: React, Ant Design Table Backend: Laravel Table Features: Displaying data in an Ant Design Table, using infinite scroll to fetch data dynamically as the user scrolls. I’ve been able to successfully use the scroll prop on the Ant Design Table component to enable vertical scrolling, but I can’t seem to trigger the data load when the user reaches the bottom of the table.
Questions:
- How can I properly trigger the data fetch when the user scrolls to the bottom of the table?
- Is there any other configuration I need to set up for the scroll event to work as expected in Ant Design’s Table?
- Should I use window.scroll instead of onScroll to detect the scroll event, or is there a better way to implement infinite scrolling with Ant Design Table?