Skip to content

Commit

Permalink
[BUG] Resolve initial infinity scroll loading issue
Browse files Browse the repository at this point in the history
Issue Resolve
opensearch-project#6033

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
  • Loading branch information
ananzh committed Mar 5, 2024
1 parent d822b33 commit 413e7b0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const LegacyDiscoverTable = ({
});
const observerRef = useRef<IntersectionObserver | null>(null);
const sentinelRef = useRef<HTMLDivElement | null>(null);

// eslint-disable-next-line react-hooks/exhaustive-deps
const loadMoreRows = () => {
setRenderedRowCount((prevRowCount) => prevRowCount + 50); // Load 50 more rows
};
Expand All @@ -96,7 +96,7 @@ export const LegacyDiscoverTable = ({
observerRef.current.unobserve(sentinel);
}
};
}, []);
}, [loadMoreRows]);

const [activePage, setActivePage] = useState(0);
const pageCount = Math.ceil(rows.length / pageSize);
Expand Down

0 comments on commit 413e7b0

Please sign in to comment.