The following code update some data, refetches it, and then waits for an image field to load:
api.updateBuildings(payload).then(result => {
this.fetchBuildings(() => {
const image = new Image()
image.src = result.data.web
this.setIsLoading(false)
image.onload = () => {
console.log('LOADED:', image.onload())
}
})
})
However, image.onload
throws Maximum Call Stack Size Exceeded
.
Why is this?
EDIT:
result.data
looks like this:
{
app: "http://ac-0uhksb6K.clouddn.com/370b989e0ceec6329fb6.jpg? imageView/2/w/4096/h/2048/q/100/format/png"
categoryType : "livingroom"
web: "http://ac-0uhksb6K.clouddn.com/370b989e0ceec6329fb6.jpg?imageView/2/w/4096/h/2048/q/100/format/png"
}