const List = ({people}) => {
return (
<>
{people.map(person =>{
const {id,name,age,image} = person;
return (
<article key={id} className='person'>
<img src={image} alt={name} />
<div>
<h4>{name}</h4>
<p>{age} years</p>
</div>
</article>
);
})}
</>
);
};
Asked
Active
Viewed 24 times
0

Yousaf
- 27,861
- 6
- 44
- 69
-
1See: [MDN - Destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) – Yousaf Oct 12 '20 at 12:23
-
`props` destructuring.. Duplicated from above – Dupocas Oct 12 '20 at 12:24