Skip to content

Commit c8c6246

Browse files
AsmadeusAljullu
authored andcommitted
Render image once to prevent double downloading (#56)
1 parent 00bfd85 commit c8c6246

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/components/LazyLoadImage.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,9 @@ class LazyLoadImage extends React.Component {
122122

123123
render() {
124124
const { effect, placeholderSrc, visibleByDefault } = this.props;
125-
const { loaded } = this.state;
126125

127126
const image = this.getImg();
128-
const lazyLoadImage = loaded ? image : this.getLazyLoadImage(image);
127+
const lazyLoadImage = this.getLazyLoadImage(image);
129128

130129
if ((!effect && !placeholderSrc) || visibleByDefault) {
131130
return lazyLoadImage;

0 commit comments

Comments
 (0)