Skip to content

Commit

Permalink
clean up image element props
Browse files Browse the repository at this point in the history
  • Loading branch information
atcastle committed Mar 10, 2022
1 parent 74076ff commit a000df1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
2 changes: 0 additions & 2 deletions docs/api-reference/next/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ module.exports = {
}
```


### Experimental "raw" layout mode

The image component currently supports an additional `layout="raw"` mode, which renders the image without wrappers or styling. This layout mode is currently an experimental feature, while user feedback is gathered. As there is the possibility of breaking changes to the `layout="raw"` interface, the feature is locked behind an experimental feature flag. If you would like to use the `raw` layout mode, you must add the following to your `next.config.js`:
Expand All @@ -490,7 +489,6 @@ The default [loader](#loader) will automatically bypass Image Optimization for a

Auto-detection for animated files is best-effort and supports GIF, APNG, and WebP. If you want to explicitly bypass Image Optimization for a given animated image, use the [unoptimized](#unoptimized) prop.


## Related

For an overview of the Image component features and usage guidelines, see:
Expand Down
34 changes: 16 additions & 18 deletions packages/next/client/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -758,22 +758,20 @@ export default function Image({
}, [srcString, layout, placeholder, isVisible])
const imgElementArgs = {
isLazy,
...{
imgAttributes,
heightInt,
widthInt,
qualityInt,
layout,
className,
imgStyle,
blurStyle,
imgRef,
loading,
config,
unoptimized,
loader,
},
srcString: srcString,
imgAttributes,
heightInt,
widthInt,
qualityInt,
layout,
className,
imgStyle,
blurStyle,
imgRef,
loading,
config,
unoptimized,
loader,
srcString,
...rest,
}
return (
Expand Down Expand Up @@ -866,7 +864,7 @@ const ImageElement = ({
ref={imgRef}
style={{ ...imgStyle, ...blurStyle }}
/>
{(isLazy || placeholder === 'blur') &&
{(isLazy || placeholder === 'blur') && (
<noscript>
<img
{...rest}
Expand All @@ -891,7 +889,7 @@ const ImageElement = ({
loading={loading || 'lazy'}
/>
</noscript>
}
)}
</>
)
}
Expand Down

0 comments on commit a000df1

Please sign in to comment.