Skip to content

Instantly share code, notes, and snippets.

@samuelayo
Created January 29, 2018 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuelayo/9d95f854d03cb1ef70a83d836d7617e1 to your computer and use it in GitHub Desktop.
Save samuelayo/9d95f854d03cb1ef70a83d836d7617e1 to your computer and use it in GitHub Desktop.
componentDidMount() {
// Detect when scrolled to bottom.
this.refs.myscroll.addEventListener("scroll", () => {
if (
this.refs.myscroll.scrollTop + this.refs.myscroll.clientHeight >=
this.refs.myscroll.scrollHeight
) {
this.loadMore();
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment