As per react-data-grid documentation, https://adazzle.github.io/react-data-grid/docs/implementation-notes, we have access to the following props
rowVisibleStartIdx
- The index of the first visible row to be rendered to the canvas.
rowVisibleEndIdx
- The index of the last visible row to be rendered to the canvas.
With the visible rows start and end indexes, you can assert the rows that are currently visible on the table canvas onScroll.
Provide onScroll handler to the table
onScroll = ({ rowVisibleStartIdx, rowVisibleEndIdx }) => {
console.log(rowVisibleStartIdx, rowVisibleEndIdx);
// The visible indexes will be updated as your canvas view port changes.
// use this to assert the currently visible rows from your data.
};
<ReactDataGrid
// ... other props
onScroll={this.onScroll}
/>
Hope this is helpful!