mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This PR introduces breaking changes by renaming components. - Rename `next/image` to `next/legacy/image` - Rename `next/future/image` to `next/image` The diff is very confusing because both components are very similar so git got confused.
38 lines
793 B
JavaScript
38 lines
793 B
JavaScript
import React from 'react'
|
|
import Image from 'next/legacy/image'
|
|
|
|
const Page = () => {
|
|
return (
|
|
<div>
|
|
<h1>Warn when "sizes" is not used</h1>
|
|
<Image
|
|
layout="fixed"
|
|
src="/test.png"
|
|
width={400}
|
|
height={400}
|
|
sizes="50vw"
|
|
/>
|
|
<Image
|
|
layout="intrinsic"
|
|
src="/test.jpg"
|
|
width={400}
|
|
height={400}
|
|
sizes="50vw"
|
|
/>
|
|
<Image
|
|
layout="responsive"
|
|
src="/test.webp"
|
|
width={400}
|
|
height={400}
|
|
sizes="50vw"
|
|
/>
|
|
<div style={{ position: 'relative', width: '200px', height: '200px' }}>
|
|
<Image src="/test.gif" layout="fill" objectFit="cover" sizes="50vw" />
|
|
</div>
|
|
<footer>footer</footer>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Page
|