Aljullu / react-lazy-load-image-component

React Component to lazy load images and components using a HOC to track window scroll position.
https://www.npmjs.com/package/react-lazy-load-image-component
MIT License
1.44k stars 109 forks source link

Lazy load isn't working? #124

Closed monolithed closed 11 months ago

monolithed commented 1 year ago

When I use tabs, the first one displays with a placeholder, but the others do not. Is there a way to add a placeholder for images that are currently hidden? I've tried using trackWindowScroll, but it doesn't have any effect. When I switch to another tab, the placeholder is no longer there, even though the image hasn't loaded yet.

Screenshot 2023-09-01 at 16 40 29 Screenshot 2023-09-01 at 16 38 15
jotacodestudio commented 11 months ago

Thanks for reaching out to us, @monolithed. In the scenario you shared, it shouldn't be needed to lazy load the images, as they will only be loaded by the browser once the user activates the relevant tab. Does it make sense?

So, in your specific situation, we recommend not using React Lazy Load Image Component as it doesn't seem to be needed. We will go ahead and close this issue, but please feel free to reopen it if you believe the resolution is not appropriate.

monolithed commented 11 months ago

@flyingcodestudio I disagree because it works out of the box in NextJS

monolithed commented 11 months ago

@flyingcodestudio, This component isn't tied to any specific system, unlike NextJS, and its purpose is to handle such scenarios. By closing the ticket, you're not offering any alternatives. So, if I need a blur effect on tabs, am I expected to create my own component? Why was NextJS able to implement this out of the box?