Infinite Scroll
Automatically load more data as the user scrolls near the bottom.
ID
Name
Email
Department
Salary
50 rows loaded · Scroll to load more
Trigger a callback when scrolling near the bottom:
const { handleScroll } = useVirtualTable({
data,
columns,
onScrollToBottom: () => {
if (!isFetching && hasNextPage) {
fetchNextPage();
}
},
scrollBottomThreshold: 500,
});
<div ref={containerRef} onScroll={handleScroll}>| Option | Type | Default |
|---|---|---|
onScrollToBottom | () => void | — |
scrollBottomThreshold | number | 100 |