#397·lazyload

Cannot set property 'settings' of undefined

Author: tsechinghoCreated Nov 1, 2017Updated Dec 18, 2024

I use jquery-lazyload 1.9.7 with reactjs, it works well. I try to use lazyload 2.0.0-beta.2 with reactjs, I got errors like

Uncaught (in promise) TypeError: Cannot set property 'settings' of undefined
    at LazyLoad (lazyload.js:78)

my react component call lazyload like

javascript
  componentDidMount() {
    const images = this.node.querySelectorAll('.lazyload')
    lazyload(images, {
      threshold: 200,
    })
  }

I think it should be a bug.