Cannot set property 'settings' of undefined
See original GitHub issueI 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
componentDidMount() {
const images = this.node.querySelectorAll('.lazyload')
lazyload(images, {
threshold: 200,
})
}
I think it should be a bug.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11
Top Results From Across the Web
JavaScript - cannot set property of undefined - Stack Overflow
d[a] == undefined , so you're doing undefined['greeting']=b; and by definition, undefined has no properties. Thus, the error you received. Share.
Read more >Uncaught TypeError: Cannot set property
In JavaScript if a variable has been declared, but has not been assigned a value, is automatically assigned the value undefined . Therefore,...
Read more >How to solve the 'cannot set property of undefined' issue on ...
To access an object key the object has to exist. When it doesn't and you try to access the key, you get the...
Read more >jQuery - Cannot read property 'settings' of undefined - YouTube
jQuery : JQuery Validate Uncaught TypeError: Cannot read property ' settings' of undefined [ Beautify Your Computer ...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
The TypeError: Cannot read property of undefined is one of the most common type errors in JavaScript. It occurs when a property is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do not use
lazyload()
instead ofnew lazyload()
I had the same problem and it was because I was not calling properly Lazyload. Initially I was doing this:
But, what I should do is: