componentDidMount() {
window.addEventListener('scroll', this.handleScroll);
}
componentWillUnmount() {
window.removeEventListener('scroll', this.handleScroll);
}
handleScroll = (e) => {
if (window.innerHeight + window.scrollY > document.body.clientHeight - 100) {
console.log('I need to load some more content here…');
}
}