Я настраиваю реактивно-виртуализированный загрузчик Infinite в моем проекте, но у меня есть небольшая проблема. Так что у меня нет remoteRowCount, поэтому я нашел одно решение, например:
public rowCount = this.props.hasNextPage ? this.props.list.length + 1 : this.props.list.length;
Но это не работает для меня. Я пытался отладить, почему не работает, но я ничего не нашел.
р
public rowCount = this.props.hasNextPage ? this.props.list.length + 1 : this.props.list.length;
<InfiniteLoader
rowCount={this.rowCount}
isRowLoaded={({ index }) => !!this.props.list[index]}
loadMoreRows={this.props.loadMoreRows}
minimumBatchSize={10}
threshold={5}
>
{({ onRowsRendered, registerChild }) => (
<WindowScroller>
{({ height, isScrolling, onChildScroll, scrollTop }) => (
<AutoSizer disableHeight>
{({ width }) => (
<List
ref={list => {
this.listRef = list;
registerChild(list);
}}
onRowsRendered={onRowsRendered}
autoHeight
width={width}
height={height}
rowCount={this.props.list.length}
rowHeight={56}
rowRenderer={this.rowRenderer}
overscanRowCount={0}
isScrolling={isScrolling}
onScroll={onChildScroll}
scrollTop={scrollTop}
/>
)}
</AutoSizer>
)}
</WindowScroller>
)}
</InfiniteLoader>