Load local image in React JS

Viewed 134

im unable to Load local image in React JS this is the file location:

ive tried using

<img id="shoe1" src="shoe1.jpg"alt="shoe1"/>
<img id="shoe1" src="./shoe1.jpg"alt="shoe1"/>

enter image description here

and within the folder like this too:

<img id="shoe1" src="../img/shoe1.jpg"alt="shoe1"/>
<img id="shoe1" src="./img/shoe1.jpg"alt="shoe1"/>

enter image description here

3 Answers
import imgg from "../img/shoe1.jpg";

<img src={imgg} alt="yourimagecomeshere" />

can you move the image to assets folder and do something like this

<img id="shoe1" src="../assets/shoe1.jpg"alt="shoe1"/>
Related