Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const heightOffset = 1500;
...
windowSizeHandler = e => {
const isBottomReached =
window.scrollY + window.innerHeight + heightOffset >=
document.body.offsetHeight;
this.setState({ isBottomReached }, async () => {
if (isBottomReached) await this.getNextPosts();
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.