I would like to use .png files in my React project. I am using typescript. Although I wrote:
declare module "*.png";
in react-app-env.d.ts
fileimport image from '../../images/profile.png'
and <Image src={require(image)} alt="profile"/>
I still reveice error:
Cannot find module '/static/media/profile.61e9dd382cf050df64b8.png'
Okey, for everyone who has the same problem. Instead of importing images try:
const image = require("../../images/profile.png")
and the just:
<Image src={image} alt="profile"/>