Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

[Feature Request] Lazy loading #28

Open
halafi opened this issue Feb 1, 2019 · 4 comments
Open

[Feature Request] Lazy loading #28

halafi opened this issue Feb 1, 2019 · 4 comments

Comments

@halafi
Copy link

halafi commented Feb 1, 2019

hi there,
any plans to support only loading images in viewport (lazy-load)?

@a-ssassi-n
Copy link

a-ssassi-n commented Feb 1, 2019

Have you tried using this https://github.com/twobin/react-lazyload

import LazyLoad from "react-lazyload";
....
 <LazyLoad>
    <ProgressiveImage
        delay={2500}
        src={image}
        placeholder={placeholder_image}
    >
        {src => (
            <img
                src={src}
            />
        )}
    </ProgressiveImage>
</LazyLoad>

@halafi
Copy link
Author

halafi commented Feb 1, 2019

I didn't want to use both libraries unless I have to, but I can confirm that it works (not sure if this doesn't lead to unnecessary double loading of images).

I am curious how much work extending react-progressive-image would be to support lazy loading and if this would be desired PR or if it would solve different problem than what's the library purpose.

@brybrophy
Copy link
Contributor

I think that it does solve a different problem than the intended purpose of react-progressive-image. I know from making past contributions to this package that it is always desirable to keep extraneous functionality separate. Plus, using a package dedicated to lazy loading to wrap your images seems to make a lot more sense, since the maintainers of that package will be able to keep it healthy. This package is barely maintained as it is.

@sanishkr
Copy link

I didn't want to use both libraries unless I have to, but I can confirm that it works (not sure if this doesn't lead to unnecessary double loading of images).

I am curious how much work extending react-progressive-image would be to support lazy loading and if this would be desired PR or if it would solve different problem than what's the library purpose.

@halafi You can use react-progressive-graceful-image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants