Unverified Commit 9aa282b4 authored by Pakapon Kaewmark's avatar Pakapon Kaewmark Committed by GitHub

Remove `lazyRoot` example from `next/future/image` doc (#38140)

According to the 12.2 release note and the source code, the `next/future/image` does not use `IntersectionObserver` anymore so the `lazyRoot` prop is also not used.
The example probably got left behind unintentionally.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [X] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
parent 89c57cd8
...@@ -205,50 +205,6 @@ Try it out: ...@@ -205,50 +205,6 @@ Try it out:
You can also [generate a solid color Data URL](https://png-pixel.com) to match the image. You can also [generate a solid color Data URL](https://png-pixel.com) to match the image.
**Example pointing to a DOM element**
```jsx
import Image from 'next/future/image'
import React from 'react'
const lazyRoot = React.useRef(null)
const Example = () => (
<div ref={lazyRoot} style={{ overflowX: 'scroll', width: '500px' }}>
<Image lazyRoot={lazyRoot} src="/one.jpg" width="500" height="500" />
<Image lazyRoot={lazyRoot} src="/two.jpg" width="500" height="500" />
</div>
)
```
**Example pointing to a React component**
```jsx
import Image from 'next/future/image'
import React from 'react'
const Container = React.forwardRef((props, ref) => {
return (
<div ref={ref} style={{ overflowX: 'scroll', width: '500px' }}>
{props.children}
</div>
)
})
const Example = () => {
const lazyRoot = React.useRef(null)
return (
<Container ref={lazyRoot}>
<Image lazyRoot={lazyRoot} src="/one.jpg" width="500" height="500" />
<Image lazyRoot={lazyRoot} src="/two.jpg" width="500" height="500" />
</Container>
)
}
```
[Learn more](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/root)
### unoptimized ### unoptimized
When true, the source image will be served as-is instead of changing quality, When true, the source image will be served as-is instead of changing quality,
......
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