diff --git a/lib/index.js b/lib/index.js index 915a7f4..e345a00 100644 --- a/lib/index.js +++ b/lib/index.js @@ -354,13 +354,14 @@ var LazyLoad = function (_Component) { height = _props2.height, children = _props2.children, placeholder = _props2.placeholder, + className = _props2.className, classNamePrefix = _props2.classNamePrefix, style = _props2.style; return _react2.default.createElement( 'div', - { className: classNamePrefix + '-wrapper', ref: this.setRef, style: style }, + { className: classNamePrefix + '-wrapper ' + className, ref: this.setRef, style: style }, this.visible ? children : placeholder ? placeholder : _react2.default.createElement('div', { style: { height: height }, className: classNamePrefix + '-placeholder' @@ -373,6 +374,7 @@ var LazyLoad = function (_Component) { }(_react.Component); LazyLoad.propTypes = { + className: _propTypes2.default.string, classNamePrefix: _propTypes2.default.string, once: _propTypes2.default.bool, height: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]), @@ -390,6 +392,7 @@ LazyLoad.propTypes = { }; LazyLoad.defaultProps = { + className: '', classNamePrefix: 'lazyload', once: false, offset: 0, diff --git a/package.json b/package.json index a392af7..2773521 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-lazyload", - "version": "3.1.1", + "version": "3.2.0", "description": "Lazyload your components, images or anything where performance matters.", "main": "lib/index.js", "scripts": {