How to give Image src dynamically in react js?

if you dont want to require the image then you have to put all your images into public folder and then

<img src={`../img/${img.code}.jpg`}></img>

this method will work.

Leave a Comment