Skip to content

Commit

Permalink
chore: update next/image docs with unoptimized example (#45720)
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle authored Feb 8, 2023
1 parent 7654d7b commit 53c2ae8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion docs/api-reference/next/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,15 @@ You can also [generate a solid color Data URL](https://png-pixel.com) to match t
When true, the source image will be served as-is instead of changing quality,
size, or format. Defaults to `false`.

This prop can be assigned to all images by updating `next.config.js` with the following configuration:
```js
import Image from 'next/image'

const UnoptimizedImage = (props) => {
return <Image {...props} unoptimized />
}
```

Since Next.js 12.3.0, this prop can be assigned to all images by updating `next.config.js` with the following configuration:

```js
module.exports = {
Expand Down
10 changes: 9 additions & 1 deletion docs/api-reference/next/legacy/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,15 @@ const Example = () => {
When true, the source image will be served as-is instead of changing quality,
size, or format. Defaults to `false`.

This prop can be assigned to all images by updating `next.config.js` with the following configuration:
```js
import Image from 'next/image'

const UnoptimizedImage = (props) => {
return <Image {...props} unoptimized />
}
```

Since Next.js 12.3.0, this prop can be assigned to all images by updating `next.config.js` with the following configuration:

```js
module.exports = {
Expand Down

0 comments on commit 53c2ae8

Please sign in to comment.