I have a React app with Next.js where I import an image using:
import image1 from '../../../img/dummy-image-2.jpg';
Later on I use:
<img src={image1} alt="Dummy" />
The app builds and runs as expected (the image is shown) but I'm getting a linter error on the src
attribute in the <img>
tag that reads:
Type 'StaticImageData' is not assignable to type 'string'.
How can I get rid of this error?