React Infinitum
React Infinitum is a window infinite scroll loader
Install
npm install --save react-infinitum
Usage
;; let fakeData = city: 'Curitiba' country: 'Brazil' city: 'New York' country: 'United States' city: 'Tokyo' country: 'Japan'; Component { superprops; thisstate = cities: fakeData loadMore: true ; } { // Set loadMore to false and ReactInfinitum will be blocked this; // Simulate an AJAX request ajax ; } { return <Infinitum onReachBottom=thisloadMoreCities loadMore=thisstateloadMore> thisstatecities </Infinitum> ; } ;
Properties
Name | Type | Required? | Default Value | Description |
---|---|---|---|---|
onReachBottom |
function |
Yes | - | The callback that will be fired when window reach the page bottom |
loadMore |
boolean |
No | true |
The flag that indicate if will call the callback |
trigger |
number |
No | 0.85 | A number between 0 - 1 that indicate the window scroll percentage to reach on page bottom |