react-infinite-scroller icon indicating copy to clipboard operation
react-infinite-scroller copied to clipboard

initialLoad does not seem to work

Open jeffmcaffer opened this issue 8 years ago • 3 comments
trafficstars

I have made and assumption that that the initialLoad (default true) prop causes InfiniteScroll to call loadMore when it is first mounted. This would be great but it seems not to be the case. The initialLoad check is after a hasMore check. When the component is first loaded, the data has not necessarily been primed to hasMore will be its default falsey value. As a result, initialLoad will never be checked.

Working around this is relatively easy, kick off a load in some other component's componentWillMount() but it would be convenient if this was all co-located.

jeffmcaffer avatar Sep 11 '17 00:09 jeffmcaffer

Yeah, you right initialLoad didn't work as expected.

umair-khanzada avatar Nov 11 '17 13:11 umair-khanzada

I made the same assumption, the readme page description should probably be more descriptive.

afrigon avatar Jun 14 '18 00:06 afrigon

Also, keep in mind that the loading function will not be triggered if your scrolling offset does not hit the threshold that you set (250 px by default)

Spring3 avatar Apr 17 '19 17:04 Spring3