[react-infinite-scroller] add missing page param to loadMore method (#18428)

This commit is contained in:
Piotr Srebniak
2017-07-31 14:47:39 -07:00
committed by Sheetal Nandi
parent 9b53cc27cf
commit 225b1dc694
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
// Type definitions for react-infinite-scroller 1.0
// Project: https://github.com/CassetteRocks/react-infinite-scroller
// Definitions by: Lauri Lavanti <https://github.com/Lapanti>
// Definitions by: Lauri Lavanti <https://github.com/Lapanti>,
// Piotr Srebniak <https://github.com/psrebniak>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -33,8 +34,9 @@ declare namespace InfiniteScroll {
isReverse?: boolean;
/**
* A callback for when more items are requested by the user.
* Page param is next page index.
*/
loadMore(): void;
loadMore(page: number): void;
/**
* The number of the first page to load, with the default of 0, the first page is 1.
* Defaults to 0.
@@ -5,7 +5,7 @@ class Test1 extends React.Component {
render() {
return (
<InfiniteScroll
loadMore={() => {}}
loadMore={(page) => {}}
>
<div>Test 1</div>
</InfiniteScroll>
@@ -17,7 +17,7 @@ class Test2 extends React.Component {
render() {
return (
<InfiniteScroll
loadMore={() => {}}
loadMore={(page) => {}}
element='section'
hasMore
initialLoad={false}