Skip to content
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/next/client/future/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ const ImageElement = ({
isLazy,
fill,
placeholder,
priority,
loading,
srcString,
config,
Expand All @@ -351,6 +352,8 @@ const ImageElement = ({
className={className}
// @ts-ignore - TODO: upgrade to `@types/react@17`
loading={loading}
// https://web.dev/priority-hints/#increase-the-priority-of-the-lcp-image
fetchPriority={priority ? "high" : undefined}
style={{ ...imgStyle, ...blurStyle }}
ref={useCallback(
(img: ImgElementWithDataProp | null) => {
Expand Down Expand Up @@ -857,6 +860,7 @@ export default function Image({
fill,
unoptimized,
placeholder,
priority,
loader,
srcString,
onLoadingCompleteRef,
Expand Down
5 changes: 5 additions & 0 deletions packages/next/client/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ const ImageElement = ({
blurStyle,
isLazy,
placeholder,
priority,
loading,
srcString,
config,
Expand All @@ -503,6 +504,8 @@ const ImageElement = ({
data-nimg={layout}
className={className}
style={{ ...imgStyle, ...blurStyle }}
// https://web.dev/priority-hints/#increase-the-priority-of-the-lcp-image
fetchPriority={priority ? "high" : undefined}
ref={useCallback(
(img: ImgElementWithDataProp) => {
if (process.env.NODE_ENV !== 'production') {
Expand Down Expand Up @@ -569,6 +572,7 @@ const ImageElement = ({
sizes: noscriptSizes,
loader,
})}
fetchPriority={priority ? "high" : undefined}
decoding="async"
data-nimg={layout}
style={imgStyle}
Expand Down Expand Up @@ -1020,6 +1024,7 @@ export default function Image({
config,
unoptimized,
placeholder,
priority,
loader,
srcString,
onLoadingCompleteRef,
Expand Down