I am having an issue to render my images from my './src/img' file and have no idea where i'm going wrong...
I have an object which have a key 'image' which return the file name (ie: 'filename.jpg'). As stated before, the images are stored in an 'img' folder in the 'src' one.
in my component, i return the image like this :
<div className='image'>
<img src={require(`../img/${details.image}`)} alt={details.name} />
{
console.log(details.image)
}
</div>
i use the require function as i'm supposed to, (i think ?!^^) and indicates the folder and retrieve the image name with ${details.image}.
As you can see i'm doing a console.log of details image which returns me the filenames without fail.
When i go into the console and check the rendering, i have no issue with the alt, but the src param gives me [object Module]
And that's where i'm kind of lost as to what happens and what i did wrong there.
Thanks by advance