Skip to content
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion packages/gatsby-image/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,11 @@ class Image extends React.Component {
imgLoaded: imageInCache,
// `currentSrc` should be a string, but can be `undefined` in IE,
// !! operator validates the value is not undefined/null/""
imgCached: !!this.imageRef.current.currentSrc,
// for lazyloaded components this might be null
// TODO fix imgCached behaviour as it's now false when it's lazyloaded
imgCached: !!(
this.imageRef.current && this.imageRef.current.currentSrc
),
})
)
})
Expand Down