Skip to content

useAsyncList list.cursor not updating #5659

Answered by LFDanLu
developedbyluke asked this question in Q&A
Discussion options

You must be logged in to vote

The cursor is returned to your load function when you perform a list.loadMore call: https://codesandbox.io/s/competent-euclid-pf4c5p?file=/src/App.js but it is tracked internally starting from your initial load. For your implementation, you should call list.loadMore when the Table is scrolled down far enough similar to how we do it for our TableView's Virtualizer:

let onVisibleRectChange = useCallback((rect: Rect) => {
state.setVisibleRect(rect);
if (!isLoadingRef.current && onLoadMore) {
let scrollOffset = state.virtualizer.contentSize.height - rect.height * 2;

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@developedbyluke
Comment options

Answer selected by developedbyluke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants