loktar00 / react-lazy-load

React component that renders children elements when they enter the viewport.
MIT License
978 stars 166 forks source link

added lazy load for whole container out of viewport #98

Closed leopittelli closed 4 years ago

leopittelli commented 7 years ago

Imagine a carousel of images. If each item is Lazy loaded, the first items will be loaded and the ones at the right will wait until the user scrolls horizontally.

If the carousel is out of the initial viewport, the first images will also be loaded because they are "visible" on the container, but they are out of the screen. So, in this pull request I'm waiting the user scrolls to see the carousel in order to load the first images and then continue normally.

leopittelli commented 7 years ago

@loktar00 how do you see this?

Noahnrg commented 4 years ago

@loktar00 I'm looking for a solution that fits the above problem.

Would it be possible to get this into the package?

loktar00 commented 4 years ago

@Noahnrg I have no idea how I didn't see this.... but it's been merged I'm not at my machine right now but I'll try and get the version update on NPM today.

Noahnrg commented 4 years ago

@loktar00 wow, fast response time!

Looking forward too it, thank you so much!

just to confirm, I'll be able to install the package via npm as react-lazy-load from https://www.npmjs.com/package/react-lazy-load with the new version number, and it'll have the updates... correct?

loktar00 commented 4 years ago

Correct, just updated it to 3.1.13.... kind of screwed up the vs really should be 3.1.0 oops :P but should pull down and work properly.

lol keep in mind the original PR for this was 3 years ago :/ I definitely let this package go as I was focusing on my day job a little too much for better or for worse I guess.

Noahnrg commented 4 years ago

Fantastic !! thanks so much, works like a charm :) (using react 16.13.1)