I am using react-virtualized's example on Masonry (here)
And it works. But now I'm trying to add the InfiniteLoader to the example but I cannot get it to work.
Things I've tried:
- Not using WindowScroller and defining my own height
Initially I thought it would work by removing WindowScroller but the loadMoreRows callback is never called.
Also the isRowLoaded callback is never called aswell.
A piece of code that demonstrates how it is:
<InfiniteLoader
isRowLoaded={this._isRowLoaded}
loadMoreRows={this._loadMoreRows}
rowCount={myList.length}
>
{({ onRowsRendered, isScrolling, registerChild }) => (
<WindowScroller overscanByPixels={OVERSCAN}>
{this._renderAutoSizer}
</WindowScroller>
)}
</InfiniteLoader>
From the _renderAutoSizer it is just like the example. No changes. The Masonry works as expected but cannot implement infinite scrolling.
I understand that I need to use onRowsRendered somehow. But the examples show usage with Lists and Grids. Masonry has no way of connecting with InfiniteLoader it seems.