mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
Updating the <Picture /> component to default to async image decoding (#3876)
* defaulting pictures to use decoding=async * chore: add changeset
This commit is contained in:
parent
1785e568a0
commit
f961412862
2 changed files with 6 additions and 1 deletions
5
.changeset/quiet-bananas-obey.md
Normal file
5
.changeset/quiet-bananas-obey.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/image': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Bug: Updating the <Picture /> component to default to async image decoding
|
|
@ -21,7 +21,7 @@ export interface RemoteImageProps extends Omit<PictureAttributes, 'src' | 'width
|
||||||
|
|
||||||
export type Props = LocalImageProps | RemoteImageProps;
|
export type Props = LocalImageProps | RemoteImageProps;
|
||||||
|
|
||||||
const { src, sizes, widths, aspectRatio, formats = ['avif', 'webp'], loading = 'lazy', decoding = 'eager', ...attrs } = Astro.props as Props;
|
const { src, sizes, widths, aspectRatio, formats = ['avif', 'webp'], loading = 'lazy', decoding = 'async', ...attrs } = Astro.props as Props;
|
||||||
|
|
||||||
const { image, sources } = await getPicture({ loader, src, widths, formats, aspectRatio });
|
const { image, sources } = await getPicture({ loader, src, widths, formats, aspectRatio });
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in a new issue