A versatile infinite scroll [React] component.


A versatile infinite scroll React component.

bower install react-list

The list of items to be rendered.

A function that receives the rendered items as children. You must set ref='items' on the element that contains children so item calculations can be made. By default this element is a <div>.

A function that receives an item (and its relative index) and returns the content to be rendered for that item.

A function that should return a loading message.

A function that receives an error from a failed fetch and should return an error message.

A function that should return a message when no items are available to render.

A number that specifies how many items to render per page (this is calculated automatically for uniform items).

The number of pixels to ensure the top and bottom of the list is buffered with.

A boolean that specifies whether or not the rendered items are of uniform width and height. Uniform items allow space to be preallocated on the page without actually rendering the items.

A function that receives a callback. The callback should be invoked when the fetch is complete with the error (if any) as the first argument and a boolean determining whether the entire list is fetched or not.

Check out the test file for a full example.