How to show image as placeholder

This issue has been tracked since 2020-10-12.

I am trying to just an image as a placeholder, but instead of showing my image, it just shows a bunch of characters (the data of the image, maybe?) Do you have some sample code I can use cause I'm not doing this right. I also tried to access the image directly, which also didn't work.

I have this code

import LazyLoad from 'react-lazyload';
import LazyImg from "../../assets/img/lazyload.png";

I am trying to lazy load a card image
<LazyLoad height={300} placeholder={LazyImg}>
<Card.Img variant="top" src={amiibo.image} />

dylanfpaul wrote this answer on 2021-03-16

Try using LazyImg as the src attribute on an img element. Use the img element as the placeholder prop.

tsbajwa wrote this answer on 2021-04-06

You need to change placeholder to placeholder={<img src={LazyImg} />}

More Details About Repo
Owner Name twobin
Repo Name react-lazyload
Full Name twobin/react-lazyload
Language JavaScript
Created Date 2015-08-07
Updated Date 2022-11-29
Star Count 5639
Watcher Count 52
Fork Count 482
Issue Count 153


Issue Title Created Date Updated Date