Unverified Commit 8a5e1ceb authored by hjaber's avatar hjaber Committed by GitHub

Update missing curly brace in image.md (#34307)

* Update missing curly brace in image.md

Missing curly brace in lazyRoot component code example

* add return
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 1aee9358
......@@ -252,19 +252,23 @@ const Example = () => (
import Image from 'next/image'
import React from 'react'
const Container = React.forwardRef((props, ref) =>
<div ref={ref} style={{ overflowX: 'scroll', width: '500px' }}>
{props.children}
</div>
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>)
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>
)
}
```
......
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