Do you think it's more beneficial to use 'next/image' rather than the traditional img tag? If so, why?
I am trying to display an image by specifying width and height in styles using a class called 'img', like this...
<img className="img" src='url/img.png'/>
The 'img' class automatically sets the width and height in rem units. I'm unable to utilize the next/image tag because it requires specific pixel widths and does not support 'auto'. Is there any alternative solution for this issue?
One potential workaround is to wrap the img tag within a div element with the 'img' class and apply layout='fill', as shown below.
import Image from 'next/image';
<div className='img'>
<Image layout='fill' src="lll.jpg"/>
</div>
However, this approach feels unnecessary to me. What are your thoughts on this matter?