Fix local image example (#6019)

- `aspectRatio` prop requires a `width` or `height` prop

Co-authored-by: BryceRussell <19967622+BryceRussell@users.noreply.github.com>
This commit is contained in:
Bryce Russell 2023-01-29 03:00:48 -06:00 committed by GitHub
parent 9c298aa5ae
commit b6bed15a00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -530,7 +530,7 @@ import heroImage from '../assets/hero.png';
<Image src={heroImage} width={300} height={600} alt="descriptive text" />
// cropping to a specific aspect ratio and converting to an avif format
<Image src={heroImage} aspectRatio="16:9" format="avif" alt="descriptive text" />
<Image src={heroImage} width={300} aspectRatio="16:9" format="avif" alt="descriptive text" />
// image imports can also be inlined directly
<Image src={import('../assets/hero.png')} alt="descriptive text" />