File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ export default function Image({
142142 sizes,
143143 unoptimized = false ,
144144 priority = false ,
145- lazy = false ,
145+ lazy,
146146 className,
147147 quality,
148148 width,
@@ -156,11 +156,14 @@ export default function Image({
156156 // If priority and lazy are present, log an error and use priority only.
157157 if ( priority && lazy ) {
158158 if ( process . env . NODE_ENV !== 'production' ) {
159- console . error (
160- `Image with src ${ src } has both priority and lazy tags . Only one should be used.`
159+ throw new Error (
160+ `Image with src ${ src } has both priority and lazy properties . Only one should be used.`
161161 )
162162 }
163- lazy = false
163+ }
164+
165+ if ( ! priority && typeof lazy === 'undefined' ) {
166+ lazy = true
164167 }
165168
166169 useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments