Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Either strPlaceholder doesn't work or I'm doing it wrong...please help. #107

Open
badaczewski opened this issue Aug 2, 2022 · 0 comments

Comments

@badaczewski
Copy link

badaczewski commented Aug 2, 2022

From what the documentation says, I should be able to reference a 540x405 blue placeholder (my use case) image via srcPlaceholder and this should appear before the image loads...as well as occupy the space the image will be before it loads. I've tried this and I'm getting noting. I can't see the image nor do I see it referenced in the source or generated CSS classes.

Below is how I'm using it, please help.

import { LazyLoadImage } from 'react-lazy-load-image-component';
import 'react-lazy-load-image-component/src/effects/opacity.css';

I see everything loading with the assigned classes and the images do fade in quickly, so the above is correct

<LazyLoadImage loading="lazy" effect="opacity" src={prop.image_url} placeholderSrc="/placeholder_540x405.webp" />

Image loads with opacity but there is no placeholder before it loads the container is collapse until the image appears.

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

No branches or pull requests

1 participant