rsnext/test/integration/image-component/default/pages/index.js
Joe Haddad 9569f5a31a
Deprecate Image unsized property and add layout="fill" (#18562)
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>
2020-10-31 18:34:06 -04:00

14 lines
291 B
JavaScript

import React from 'react'
import Image from 'next/image'
const Page = () => {
return (
<div>
<p>Home Page</p>
<Image id="basic-image" src="/test.jpg" width="400" height="400"></Image>
<p id="stubtext">This is the index page</p>
</div>
)
}
export default Page