diff --git a/dist/InfiniteScroll.js b/dist/InfiniteScroll.js index 5bb22a3..a19b049 100644 --- a/dist/InfiniteScroll.js +++ b/dist/InfiniteScroll.js @@ -309,7 +309,7 @@ var InfiniteScroll = (function(_Component) { this.beforeScrollHeight = parentNode.scrollHeight; this.beforeScrollTop = parentNode.scrollTop; // Call loadMore after detachScrollListener to allow for non-async loadMore functions - if (typeof this.props.loadMore === 'function') { + if (this.props.hasMore && typeof this.props.loadMore === 'function') { this.props.loadMore((this.pageLoaded += 1)); this.loadMore = true; } diff --git a/src/InfiniteScroll.js b/src/InfiniteScroll.js index b08637e..d8c8a8c 100644 --- a/src/InfiniteScroll.js +++ b/src/InfiniteScroll.js @@ -216,7 +216,7 @@ export default class InfiniteScroll extends Component { this.beforeScrollHeight = parentNode.scrollHeight; this.beforeScrollTop = parentNode.scrollTop; // Call loadMore after detachScrollListener to allow for non-async loadMore functions - if (typeof this.props.loadMore === 'function') { + if (this.props.hasMore && typeof this.props.loadMore === 'function') { this.props.loadMore((this.pageLoaded += 1)); this.loadMore = true; }