Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/LazyLoad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import scrollParent from './utils/index.js';

type Props = {
children: ReactNode,
id?: string,
className?: string,
elementType?: string,
height?: string | number,
Expand All @@ -26,6 +27,7 @@ type State = {
export default class LazyLoad extends Component<Props, State> {
static defaultProps = {
elementType: 'div',
id: undefined,
className: '',
offset: 0,
threshold: 0,
Expand Down Expand Up @@ -105,7 +107,7 @@ export default class LazyLoad extends Component<Props, State> {

render() {
const {
children, className, height, width, elementType
children, id, className, height, width, elementType
} = this.props;
const { visible } = this.state;

Expand All @@ -119,6 +121,7 @@ export default class LazyLoad extends Component<Props, State> {
const componentElementType = elementType || 'div';

return createElement(componentElementType, {
id,
className: elClasses,
style: elStyles,
ref: this.wrapper
Expand Down