Upgrading NextJS to the latest version has resulted in some errors when using the Image
component:
// import Image from 'next/image'
<div style={Object.assign({}, styles.slide, style)} key={key}>
<Image
src={src}
alt=""
width={100 + '%'}
height={100 + '%'}
objectFit="cover"
/>
</div>
- 'objectFit' is now considered deprecated
- The type 'string' cannot be assigned to type 'SafeNumber'
What is the correct method for configuring the image with 100% width and height?