twobin / react-lazyload

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

Lazy Load within IFrames introduces a severe scroll lag #346

Open Beyondem opened 3 years ago

Beyondem commented 3 years ago

My react app is an ecommerce shop, with hundreds of products. Adding react-lazyload has been a huge help in speeding up the overall page, and it works beautifully.

By design, this shop gets embedded on webpages via iframes. This is where the problem begins. It seems the offset no longer applies, where things only begin loading when they are actually in view. In addition, the scroll lag is absolutely horrible and unusable now. Its like the scroll/resize listeners are running continuously and not working correctly (Still trying to debug via devtools to see what the specific problem may be).

I have found one similar issue, however theirs relates to elements not loading at all, which is not the case in my scenario. https://github.com/twobin/react-lazyload/issues/164

Hoping someone can help point me in the right direction as to what may be causing this, and how I can go about resolving it.

Thank you!