Unverified Commit 53c2ae87 authored by Steven's avatar Steven Committed by GitHub

chore: update `next/image` docs with unoptimized example (#45720)

parent 7654d7bc
...@@ -269,7 +269,15 @@ You can also [generate a solid color Data URL](https://png-pixel.com) to match t ...@@ -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, When true, the source image will be served as-is instead of changing quality,
size, or format. Defaults to `false`. 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 ```js
module.exports = { module.exports = {
......
...@@ -329,7 +329,15 @@ const Example = () => { ...@@ -329,7 +329,15 @@ const Example = () => {
When true, the source image will be served as-is instead of changing quality, When true, the source image will be served as-is instead of changing quality,
size, or format. Defaults to `false`. 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 ```js
module.exports = { module.exports = {
......
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