diff --git a/src/InfiniteScroll.js b/src/InfiniteScroll.js index b94c8e4..0345646 100644 --- a/src/InfiniteScroll.js +++ b/src/InfiniteScroll.js @@ -46,6 +46,10 @@ export default class InfiniteScroll extends Component { this.attachScrollListener(); } + componentWillReceiveProps(nextProps) { + if (nextProps.hasMore === false) { this.detachMousewheelListener(); } + } + componentWillUnmount() { this.detachScrollListener(); this.detachMousewheelListener();