我尝试使用react-virtualized
使用react-window-infinite-loader
表:
<AutoSizer disableHeight>
{(sizer) => {
return (
<InfiniteLoader
isItemLoaded={(index) => { console.log(index); return !!source[index]}} // // nothing hapens
loadMoreItems={props.onLoadMoreItems}
itemCount={props.itemCount}
>
{(infineteLoader) => (
<Table
headerClassName={styles.headerColumn}
>> onItemsRendered={(props)=>console.log(props) /*infineteLoader.onItemsRendered*/} // nothing hapens
ref={infineteLoader.ref}
headerHeight={ROW_HEIGHT}
height={height}
noRowsRenderer={() => <div className={styles.empty}>{props.emptyText}</div>}
rowClassName={styles.row}
rowHeight={ROW_HEIGHT}
rowGetter={(info) => source[info.index]}
rowCount={source.length}
width={sizer.width}
>
{props.children}
</Table>
)}
</InfiniteLoader>
)
}}
</AutoSizer>