onRowsRendered custom usage with InfiniteLoader and List
I am working my way through trying to figure out if I can have a custom "onRowsRendered" function.
As per documentation examples, both list and InfiniteLoader utilize onRowsRendered={onRowsRendered}
{({ onRowsRendered, registerChild }) => (
<List className="table table-bordered"
ref={registerChild}
onRowsRendered={onRowsRendered}
....
However I cannot seem to figure out / find a documented way of customising / modfying the fuction. I am trying to grab the startIndex and stopIndex values, however that completely stops the Infinite loader functionality.
A better example of what I am trying to achieve that works:
onRowsRendered={({ startIndex, stopIndex }) =>
this.setState({startIndex: startIndex + 1, stopIndex: stopIndex})
}
, I need same + Infinite Loader still working 👍
Now it just seems like both Infinite loader and List make user of onRowsRendered property and one cancels out the other. I do realize it's a very rare case, but would love to know if this is a bug or am I just being silly.
And for those wondering why would I need this.. Is to display number of items (From ... To..) which are currently visible, and as users scrolls up / down they update.
you should make some "proxy" to make it works.
something like this:
onRowsRendered={({ startIndex, stopIndex }) => {
onRowsRendered({ startIndex, stopIndex });
_.debounce(handleRowsRendered({ startIndex, stopIndex }),500);
}}