File tree 3 files changed +19
-1
lines changed
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @builder.io/react " : patch
3
+ " @builder.io/sdk-angular " : patch
4
+ " @builder.io/sdk-react-nextjs " : patch
5
+ " @builder.io/sdk-qwik " : patch
6
+ " @builder.io/sdk-react " : patch
7
+ " @builder.io/sdk-solid " : patch
8
+ " @builder.io/sdk-svelte " : patch
9
+ " @builder.io/sdk-vue " : patch
10
+ ---
11
+
12
+ Add loading=lazy to RawImg component for better perf
Original file line number Diff line number Diff line change @@ -32,7 +32,12 @@ class ImgComponent extends React.Component<ImgProps> {
32
32
const attributes = this . props . attributes || { } ;
33
33
const srcset = this . getSrcSet ( ) ;
34
34
return (
35
- < img { ...this . props . attributes } src = { this . props . image || attributes . src } srcSet = { srcset } />
35
+ < img
36
+ loading = "lazy"
37
+ { ...this . props . attributes }
38
+ src = { this . props . image || attributes . src }
39
+ srcSet = { srcset }
40
+ />
36
41
) ;
37
42
}
38
43
}
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ export default function ImgComponent(props: ImgProps) {
51
51
52
52
return (
53
53
< img
54
+ loading = "lazy"
54
55
style = { {
55
56
objectFit : props . backgroundSize || 'cover' ,
56
57
objectPosition : props . backgroundPosition || 'center' ,
You can’t perform that action at this time.
0 commit comments