Answers for "react load after scrolling"

0

react load after scrolling

componentWillMount(){
  window.addEventListener('scroll', this.loadMore);
}

componentWillUnmount(){
    window.removeEventListener('scroll', this.loadMore);
}

loadMore(){
    if (window.innerHeight + document.documentElement.scrollTop === document.scrollingElement.scrollHeight) {
        // Do load more content here!
    }
}
Posted by: Guest on September-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language