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({
142
142
sizes,
143
143
unoptimized = false ,
144
144
priority = false ,
145
- lazy = false ,
145
+ lazy,
146
146
className,
147
147
quality,
148
148
width,
@@ -156,11 +156,14 @@ export default function Image({
156
156
// If priority and lazy are present, log an error and use priority only.
157
157
if ( priority && lazy ) {
158
158
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.`
161
161
)
162
162
}
163
- lazy = false
163
+ }
164
+
165
+ if ( ! priority && typeof lazy === 'undefined' ) {
166
+ lazy = true
164
167
}
165
168
166
169
useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments