Skip to content

Commit

Permalink
fix(gatsby-plugin-image): Handle imgStyle in SSR (#29043)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jan 15, 2021
1 parent f23ba4b commit b9978e1
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -106,10 +106,18 @@ export const GatsbyImage: FunctionComponent<GatsbyImageProps> = function GatsbyI
<MainImage
data-gatsby-image-ssr=""
className={imgClassName}
style={imgStyle}
{...(props as Omit<MainImageProps, "images" | "fallback">)}
// When eager is set we want to start the isLoading state on true (we want to load the img without react)
{...getMainProps(loading === `eager`, false, cleanedImages, loading)}
{...getMainProps(
loading === `eager`,
false,
cleanedImages,
loading,
undefined,
undefined,
undefined,
imgStyle
)}
/>
</LayoutWrapper>
</GatsbyImageHydrator>
Expand Down

0 comments on commit b9978e1

Please sign in to comment.