Skip to content

Commit ab61b94

Browse files
Merge pull request #334 from AlexMeah/patch-1
Add support for a custom className
2 parents d0205d4 + 084923d commit ab61b94

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,13 @@ class LazyLoad extends Component {
333333
height,
334334
children,
335335
placeholder,
336+
className,
336337
classNamePrefix,
337338
style
338339
} = this.props;
339340

340341
return (
341-
<div className={`${classNamePrefix}-wrapper`} ref={this.setRef} style={style}>
342+
<div className={`${classNamePrefix}-wrapper ${className}`} ref={this.setRef} style={style}>
342343
{this.visible ? (
343344
children
344345
) : placeholder ? (
@@ -355,6 +356,7 @@ class LazyLoad extends Component {
355356
}
356357

357358
LazyLoad.propTypes = {
359+
className: PropTypes.string,
358360
classNamePrefix: PropTypes.string,
359361
once: PropTypes.bool,
360362
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -375,6 +377,7 @@ LazyLoad.propTypes = {
375377
};
376378

377379
LazyLoad.defaultProps = {
380+
className: '',
378381
classNamePrefix: 'lazyload',
379382
once: false,
380383
offset: 0,

0 commit comments

Comments
 (0)