I'm doing a React/Redux project, and need to implement a virtualized/infinite-loading list. react-virtualized
seems intended to do the job, but even after reading all of the available docs and reading a number of StackOverflow posts, I haven't been able to get it working or found a clear explanation of the mechanics of how the components actually work.
The primary examples I've looked at are:
https://github.com/bvaughn/react-virtualized/blob/master/docs/creatingAnInfiniteLoadingList.md
https://github.com/bvaughn/react-virtualized/blob/master/docs/InfiniteLoader.md#examples
The primary issues I'm running into are:
It's very unclear how the loader is triggered to make a call to
loadMoreRows()
in the initial load/render case. Typical scenario is that we'd design the component to initialize itself with data by callingloadMoreRows()
when it's initially rendered. The config values necessary to make this happen aren't obvious.It's not clear whether the
rowCount
property is intended to represent the current state of loaded rows (the number of rows in a block/page of data), or the total count of the full set of row data. And, in either case, these can't be known in advance of making the initial AJAX load call, so what's the intention for setting the initial value ofrowCount
?
I've tried putting the code from various examples into my project, but I never see the loadMoreRows
call being made. I think what's need is a fleshed-out example that demonstrates a very typical use case of a) initially rendering an empty List, which then triggers an initial data load call; b) updating the rowCount
property, and when/where to do this; c) managing the currently-loaded data set representing the current block/page of data.
Any pointers would be much appreciated.