Files
StevenandGitHub 241195ddd6 BREAKING CHANGE: Rename next/image to next/legacy/image & rename next/future/image to next/image (#41399)
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.
2022-10-14 01:59:22 +00:00

62 lines
1.4 KiB
JavaScript

import React, { useRef } from 'react'
import Image from 'next/legacy/image'
const Page = () => {
const myRef = useRef(null)
return (
<>
<div
ref={myRef}
style={{
width: '100%',
height: '400px',
position: 'relative',
overflowY: 'scroll',
}}
>
<div style={{ width: '400px', height: '600px' }}>hello</div>
<div style={{ width: '400px', position: 'relative', height: '600px' }}>
<Image
id="myImage1"
src="/test.jpg"
alt="mine"
width="400"
height="400"
lazyBoundary="1500px"
/>
<Image
lazyRoot={myRef}
id="myImage2"
src="/test.png"
alt="mine"
width="400"
height="400"
lazyBoundary="1800px"
/>
<Image
lazyRoot={myRef}
id="myImage3"
src="/test.svg"
alt="mine"
width="400"
height="400"
lazyBoundary="1800px"
/>
<Image
lazyRoot={myRef}
id="myImage4"
src="/test.webp"
alt="mine"
width="400"
height="400"
lazyBoundary="200px"
/>
</div>
</div>
</>
)
}
export default Page