Skip to content

Commit 1f7d24b

Browse files
committed
Add ref prop to custom placeholder
1 parent cc3f3c0 commit 1f7d24b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/LazyLoadImage.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class LazyLoadImage extends React.PureComponent {
123123
const { className, height, placeholder, width } = this.props;
124124

125125
if (placeholder) {
126-
return placeholder;
126+
return React.cloneElement(placeholder, { ref: 'placeholder' });
127127
}
128128

129129
return (

0 commit comments

Comments
 (0)