{
storedfiles.map(item => {
// return <li key={item.id}>{item.imagepath}</li>
return (
<div>
<li key={item.id}>{item.imagepath}</li>
<img src={require(`${item.imagepath}`)} style={{width:"100px" , height:'100px'}} alt='pics' />
</div>
)
})
}
i am getting image path from the database which is { item.imagepath }, you can see in the img tag. it is not working , it says couldn't find that module. "...path" but when i put that hard corded path on the place of variable , it shows an img . mean with hard corded value it's working and with variable it's not. How could i solve it?