I have the following function create dynamic array.
funcListMap(_ref) {
let list = [];
_ref.map((i) => {
list.push(
<ListItem key={i.id}>
<h1>{i.id}</h1>
<span>{i.descricao}</span>
<img src={require(''${i.img}'')} />
<span>{i.valor}</span>
</ListItem>
)
})
return (list);
}
Only you are giving an error when loading the image
<Img src={require(''${i.img}'')} />
// Ou se tentar assim
<Img src={require(i.imagens)}/>
But if I put one in the way the form works manually, that is, it loads the same image for everyone.
<Img src={require('../statics/imagens/sanduiches/sanduiche-01.png')} />
How to resolve the issue in this code
<Img src={require(''${i.img}'')} /> ou <Img src={require(i.imagens)}/>