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 = () => ( ...@@ -252,19 +252,23 @@ const Example = () => (
import Image from 'next/image' import Image from 'next/image'
import React from 'react' import React from 'react'
const Container = React.forwardRef((props, ref) => const Container = React.forwardRef((props, ref) => {
return (
<div ref={ref} style={{ overflowX: 'scroll', width: '500px' }}> <div ref={ref} style={{ overflowX: 'scroll', width: '500px' }}>
{props.children} {props.children}
</div> </div>
)
}) })
const Example = () => { const Example = () => {
const lazyRoot = React.useRef(null) const lazyRoot = React.useRef(null)
return (<Container ref={lazyRoot}> return (
<Container ref={lazyRoot}>
<Image lazyRoot={lazyRoot} src="/one.jpg" width="500" height="500" /> <Image lazyRoot={lazyRoot} src="/one.jpg" width="500" height="500" />
<Image lazyRoot={lazyRoot} src="/two.jpg" width="500" height="500" /> <Image lazyRoot={lazyRoot} src="/two.jpg" width="500" height="500" />
</Container>) </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