DEV Community

Discussion on: Creating an Infinite Scroll Hook

Collapse
 
thomasledoux1 profile image
Thomas Ledoux

Nice implementation!
I think you might be able to simplify this by using the Intersection API (developer.mozilla.org/en-US/docs/W...). This has the threshold built in, you can pass a rootElement, rootMargin... This article explains how you could implement this: dev.to/somtougeh/building-infinite...

Collapse
 
hnrq profile image
Henrique Ramos • Edited

Nice! Didn't know about that, will definitely take a look! Thanks for the suggestion