mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
[react-infinite-scroller] add missing page param to loadMore method (#18428)
This commit is contained in:
committed by
Sheetal Nandi
parent
9b53cc27cf
commit
225b1dc694
+4
-2
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user