From beab83c2d4d2e70ebd571a319e63e29835305114 Mon Sep 17 00:00:00 2001 From: Adrien Denat Date: Tue, 19 Jan 2021 22:17:16 +0000 Subject: [PATCH] fix(gatsby-plugin-image): pass down missing sizes attribute to --- .../gatsby-plugin-image/src/components/picture.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/gatsby-plugin-image/src/components/picture.tsx b/packages/gatsby-plugin-image/src/components/picture.tsx index 91d34040354f7..8b0cfd740f44c 100644 --- a/packages/gatsby-plugin-image/src/components/picture.tsx +++ b/packages/gatsby-plugin-image/src/components/picture.tsx @@ -66,11 +66,17 @@ const Image: FunctionComponent = function Image({ export const Picture = forwardRef( function Picture( - { fallback, sources = [], shouldLoad = true, ...props }, + { fallback, sources = [], shouldLoad = true, sizes, ...props }, ref ) { const fallbackImage = ( - + ) if (!sources.length) { @@ -85,6 +91,7 @@ export const Picture = forwardRef( type={type} media={media} srcSet={srcSet} + sizes={sizes} /> ))} {fallbackImage}