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.
You can still use require
<img src={require(`./img/${img.code}.jpg`)}/>
It's not recommended to manually add images to the public folder. See this answer here: https://stackoverflow.com/a/44158919/1275105