Merge pull request #28553 from davidkevork/master

Update ankeetmaini/react-infinite-scroll-component declaration
This commit is contained in:
Armando Aguirre
2018-08-31 12:59:53 -07:00
committed by GitHub
2 changed files with 9 additions and 2 deletions
+8 -2
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/ankeetmaini/react-infinite-scroll-component#readme
// Definitions by: Stephanie Roy <https://github.com/sroy3>
// Bartosz Dotryw <https://github.com/burtek>
// David Kevork <https://github.com/davidkevork>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -34,7 +35,7 @@ declare namespace InfiniteScroll {
/**
* You can send a loader component to show while the component waits for the next load of data. e.g. <h3>Loading...</h3> or any fancy loader element
*/
loader?: React.ReactNode;
loader: React.ReactNode;
/**
* This function will be called, it should return the fresh data that you want to show the user
@@ -59,7 +60,7 @@ declare namespace InfiniteScroll {
/**
* Any JSX that you want to show the user, default={<h3>Release to refresh</h3>}
*/
releaseToRefreshContent?: boolean;
releaseToRefreshContent?: React.ReactNode;
/**
* A threshold value defining when InfiniteScroll will call next. Default value is 0.8. It means the next will be called when user comes below 80% of the total height.
@@ -84,6 +85,11 @@ declare namespace InfiniteScroll {
*/
hasChildren?: boolean;
/**
* Children component which will be rendered
*/
children?: React.ReactNode;
/**
* Set a scroll y position for the component to render with.
*/
@@ -10,6 +10,7 @@ const props: InfiniteScroll.InfiniteScrollProps = {
dataLength: 4,
hasMore: true,
endMessage: 'The end.',
loader: <h3>Loading...</h3>,
next: () => null,
};