DEV Community

Discussion on: React Infinite Scroll Tutorial: With and Without a Library

Collapse
 
adrienpoly profile image
Adrien Poly

Thanks for this article. For the version without any library it would be nice to use the intersection observer rather that the onScroll event. That would be much more efficient

Collapse
 
syakirurahman profile image
Syakir Rahman

Thanks for the suggestion. Do you have any reference for that?

Collapse
 
anders profile image
Anders

developer.mozilla.org/en-US/docs/W...

Not supported in IE11 though, if that is of any concern

Thread Thread
 
theonlybeardedbeast profile image
TheOnlyBeardedBeast

you can find a polyfill

Thread Thread
 
anders profile image
Anders

Yeah, or write a tiny abstraction on top of the code that is already there, that is "probably" better.

Collapse
 
adrienpoly profile image
Adrien Poly

here is an article in Vanilla JS about implementing a back to top button with Observers
it is pretty similar to fetching new scrollable items
m.signalvnoise.com/how-to-back-to-...