I cannot get images in the images folder in react

I’m trying to do a memory card game with react. I can’t get the photos in the img folder to app.js.

enter image description here

I wrote the photos in appjs like this.

enter image description here

I have defined a url for pciture but the pictures are not visible.

enter image description here

Answer

smurf is Array, try this:

...
return smurfs.map(smurfData=>(
  <img src={smurfData.pic} alt={smurfData.name}/>
));

Leave a Reply

Your email address will not be published. Required fields are marked *