Skip to content

Commit 0f6df6b

Browse files
committed
add img fetchPriority
1 parent 1f937d7 commit 0f6df6b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/Image.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,12 @@ export default function Image({
55
priority,
66
...props
77
}: ImgHTMLAttributes<HTMLImageElement> & { priority?: boolean }) {
8-
return <img alt={alt} {...props} loading={priority ? "eager" : "lazy"} />;
8+
return (
9+
<img
10+
alt={alt}
11+
{...props}
12+
loading={priority ? "eager" : "lazy"}
13+
fetchPriority={priority ? "high" : "auto"}
14+
/>
15+
);
916
}

0 commit comments

Comments
 (0)