Skip to content

Commit e0d0e33

Browse files
committed
feat: support setting style to wrapper div
1 parent f7ee0a7 commit e0d0e33

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/index.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,12 @@ class LazyLoad extends Component {
333333
height,
334334
children,
335335
placeholder,
336-
classNamePrefix
336+
classNamePrefix,
337+
style
337338
} = this.props;
338339

339340
return (
340-
<div className={`${classNamePrefix}-wrapper`} ref={this.setRef}>
341+
<div className={`${classNamePrefix}-wrapper`} ref={this.setRef} style={style}>
341342
{this.visible ? (
342343
children
343344
) : placeholder ? (
@@ -369,7 +370,8 @@ LazyLoad.propTypes = {
369370
debounce: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),
370371
placeholder: PropTypes.node,
371372
scrollContainer: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
372-
unmountIfInvisible: PropTypes.bool
373+
unmountIfInvisible: PropTypes.bool,
374+
style: PropTypes.object
373375
};
374376

375377
LazyLoad.defaultProps = {

0 commit comments

Comments
 (0)