File tree Expand file tree Collapse file tree
packages/hydrogen-react/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,14 +135,6 @@ export function Image({
135135 ) ;
136136 }
137137
138- if ( ! sizes ) {
139- console . warn (
140- 'No sizes prop provided to Image component, ' +
141- 'you may be loading unnecessarily large images. ' +
142- `Image used is ${ src || data ?. url } ` ,
143- ) ;
144- }
145-
146138 /* Only use data width if height is also set */
147139
148140 const dataWidth : number | undefined =
@@ -201,6 +193,14 @@ export function Image({
201193 incrementSize ,
202194 ) ;
203195
196+ if ( ! sizes && ! isFixedWidth ( normalizedWidth ) ) {
197+ console . warn (
198+ 'No sizes prop provided to Image component, ' +
199+ 'you may be loading unnecessarily large images. ' +
200+ `Image used is ${ src || data ?. url } ` ,
201+ ) ;
202+ }
203+
204204 /*
205205 * We check to see whether the image is fixed width or not,
206206 * if fixed, we still provide a srcSet, but only to account for
You can’t perform that action at this time.
0 commit comments