Unverified Commit baaca4b6 authored by HyunJick Lee's avatar HyunJick Lee Committed by GitHub

fix(docs): update width height value on example to sync with demo (#64147)

I'm looking at the example code and demo for the Image component, 
[Responsive image using a static
import](https://nextjs.org/docs/app/api-reference/components/image#responsive-image-using-a-static-import)
and [Responsive image with aspect
ratio](https://nextjs.org/docs/app/api-reference/components/image#responsive-image-with-aspect-ratio)
sections are immersive because the code in the example and the demo
match, The [Responsive image with
fill](https://nextjs.org/docs/app/api-reference/components/image#responsive-image-with-fill)
section breaks the immersion because the code in the example and the
demo are slightly different.

I think it's just a typo. It seems the width and height values are
reversed.

Attach the code from the demo.

<img width="504" alt="Responsive image with fill demo code"
src="https://github.com/vercel/next.js/assets/56260102/72ab314d-a9b3-4a88-8d9c-48f0dde8c19f">
Co-authored-by: 's avatarSteven <steven@ceriously.com>
parent f9ad49fc
...@@ -764,11 +764,11 @@ import Image from 'next/image' ...@@ -764,11 +764,11 @@ import Image from 'next/image'
export default function Page({ photoUrl }) { export default function Page({ photoUrl }) {
return ( return (
<div style={{ position: 'relative', width: '500px', height: '300px' }}> <div style={{ position: 'relative', width: '300px', height: '500px' }}>
<Image <Image
src={photoUrl} src={photoUrl}
alt="Picture of the author" alt="Picture of the author"
sizes="500px" sizes="300px"
fill fill
style={{ style={{
objectFit: 'contain', objectFit: 'contain',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment