0
I’m taking any image in a folder at the root of the project and the image doesn’t render... There’s that image icon with the alt. I’ve looked at several topics and sites, I do everything exactly the same and the image doesn’t render. However, when I use the import
javascript, it renders normally. I’m using Reactjs.
have tried:
<img src={require('../../images/planetsCard/Hoth.png')} alt="planet"/>
<img src={'../../images/planetsCard/Hoth.png'} alt="planet"/>
What I’m doing wrong???
With
require
should work... How is the image generated HTML?– Rafael Tavares
Have you ever tried to do
require('...').default
?– Luiz Felipe
I tried to
require('...').default
and it didn’t work :/– Nycollas
html is retouching like this :
<img alt="Tatooine" src="[object Module]">
– Nycollas