twobin / twobin/react-lazyload

[QUESTION]: lazyload-wrapper class

Open
#310 33 comments 6 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.9k
Forks
485
PR merge metrics
No merged PRs in 30d

Description

Hi @ameerthehacker, in the [latest commit](https://github.com/twobin/react-lazyload/commit/fa6cc889131d1ba63cdec440181b5eaf709deb20), you merged a pull request that added this span with the className `lazyload-wrapper`.

Is there a reason for this?

The previous behavior when the children was visible, was not to have any placeholder or wrapper around them.

Now because of this commit, it breaks my layout because of the extra `span` element with that class.

Is this the intended behavior?

Previous code:
```
return this.visible ? this.props.children : this.props.placeholder ? this.props.placeholder : _react2.default.createElement('div', { style: { height: this.props.height }, className: 'lazyload-placeholder' });
```

Now:
```
return _react2.default.createElement(
'span',
{ className: 'lazyload-wrapper', ref: this.setRef },
this.visible ? this.props.children : this.props.placeholder ? this.props.placeholder : _react2.default.createElement('div', {
style: { height: this.props.height },
className: 'lazyload-placeholder'
})
);
```

Please let me know, thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.