Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export const GatsbyImage: FunctionComponent<GatsbyImageProps> = function GatsbyI
layout,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
layout,
layout,
fallback,

images,
placeholder,
sizes,
backgroundColor: placeholderBackgroundColor,
} = image

Expand All @@ -65,7 +64,7 @@ export const GatsbyImage: FunctionComponent<GatsbyImageProps> = function GatsbyI
}
if (images.fallback) {
cleanedImages.fallback = {
src: images.fallback.src,
...images.fallback,
Comment on lines 65 to +67
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (images.fallback) {
cleanedImages.fallback = {
src: images.fallback.src,
...images.fallback,
if (fallback) {
cleanedImages.fallback = {
...fallback,

srcSet: images.fallback.srcSet
? removeNewLines(images.fallback.srcSet)
: undefined,
Expand Down Expand Up @@ -106,7 +105,6 @@ export const GatsbyImage: FunctionComponent<GatsbyImageProps> = function GatsbyI

<MainImage
data-gatsby-image-ssr=""
sizes={sizes}
className={imgClassName}
style={imgStyle}
{...(props as Omit<MainImageProps, "images" | "fallback">)}
Expand Down