mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Instead of hard error, we can try to convert legacy props to the new props and print a warning. We still recommend upgrading by running one (or both) codemods because the new component no longer has a wrapping `<span>`. <img width="616" alt="image" src="https://user-images.githubusercontent.com/229881/198756393-7d981686-f4db-485b-9f5f-1ff614d35959.png"> Read more: https://nextjs.org/docs/messages/next-image-upgrade-to-13
23 lines
499 B
JavaScript
23 lines
499 B
JavaScript
import Image from 'next/image'
|
|
|
|
export default function Page() {
|
|
return (
|
|
<div className="page">
|
|
<h1>Using legacy prop layout="responsive"</h1>
|
|
<p>
|
|
Even though we don't support "layout" in next/image, we can try to
|
|
correct the style and print a warning.
|
|
</p>
|
|
<Image
|
|
id="img"
|
|
layout="responsive"
|
|
src="/test.png"
|
|
width="100"
|
|
height="100"
|
|
alt="my responsive image"
|
|
priority
|
|
/>
|
|
</div>
|
|
)
|
|
}
|