Next.js 13 is out. One of the refactored components is next/image
.
I want to use it, but I want to set the image size using tailwind.
Here's my code:
import Image from 'next/image'
const Index = () => {
return (
<div>
<Image
src="https://picsum.photos/800/600"
layout="fill"
className="w-48 aspect-square md:w-72 xl:w-48"
/>
</div>
)
}
And I get this error:
Error: Image with src "https://picsum.photos/800/600" is missing required "width" property.
However, in docs it's said that it's possible to use fill
without specifying the width
and height
.
What do I miss here?