twobin / react-lazyload

Lazy load your component, image or anything matters the performance.
MIT License
5.86k stars 487 forks source link

Support IntersectionObserver #140

Open verlok opened 6 years ago

verlok commented 6 years ago

How about making a new version which uses IntersectionObserver instead of listening to the scroll event?

I can help, or my code can.

jasonslyvia commented 6 years ago

I have to admit this brand new API is really intriguing. However, as for as I know IntersectionObserver polyfill has certain pitfalls which is considered not production ready. Thoughts about that?

verlok commented 6 years ago

For my lazyload which is not a React component I give the option to conditionally load version 8, which don’t use IntersectionObserver, or version 10 depending on browser support.