Skip to content

Commit

Permalink
Update missing curly brace in image.md (vercel#34307)
Browse files Browse the repository at this point in the history
* Update missing curly brace in image.md

Missing curly brace in lazyRoot component code example

* add return

Co-authored-by: JJ Kasper <[email protected]>
  • Loading branch information
hjaber and ijjk authored Feb 14, 2022
1 parent 1aee935 commit 8a5e1ce
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions docs/api-reference/next/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)
}
```

Expand Down

0 comments on commit 8a5e1ce

Please sign in to comment.