Skip to content

Commit 75c1d55

Browse files
committed
Remove unused ref
1 parent 53df9b4 commit 75c1d55

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/components/LazyLoadImage.jsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,9 @@ class LazyLoadImage extends React.Component {
151151
const { afterLoad, beforeLoad, placeholder, scrollPosition, threshold,
152152
...props } = this.props;
153153

154-
if (!this.state.visible) {
155-
return this.getPlaceholder();
156-
}
157-
158-
return (
159-
<img
160-
{...props}
161-
ref={img => this.image = img} />
162-
);
154+
return this.state.visible ?
155+
<img {...props} /> :
156+
this.getPlaceholder();
163157
}
164158
}
165159

0 commit comments

Comments
 (0)