9569f5a31a
This PR deprecates the `unsized` property from NextImage because the property did not accomplish the desired effect. Users should rely on one of the new layouts instead: - `<Image layout="fixed" />` - `<Image layout="intrinsic" />` - `<Image layout="responsive" />` - `<Image layout="fill" />` The `unsized` property will continue to work as-is in production but is deprecated and will throw in dev. --- ### TODO: - [x] test `layout=fill` in typescript types - [x] test `layout=fill` render behavior - [x] test that `unsized` switches to `layout=fill` - [x] test `next dev` erroring on `unsized` - [ ] layout docs (tracked in issue #18554) - [ ] both `layout=fill` and `layout=responsive` use all deviceWidths in the srcset --- Fixes #18541 Co-authored-by: Steven <steven@ceriously.com>
13 lines
239 B
JavaScript
13 lines
239 B
JavaScript
import React from 'react'
|
|
import Image from 'next/image'
|
|
|
|
const Page = () => {
|
|
return (
|
|
<div>
|
|
<p>Invalid Source</p>
|
|
<Image src="https://google.com/test.png" width="10" height="10" />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Page
|