import React from 'react';
const Cards = () => {
return (
<div className="cards">
<h1>map 메서드 활용!</h1>
<div className="cardsWrapper">
{CARD_LIST.map(card => (
<span key={card.id} className="card">
{card.text}
</span>
))}
</div>
</div>
);
};
export default Cards;
const CARD_LIST = [
{ id: 1, text: 'first' },
{ id: 2, text: 'second' },
{ id: 3, text: 'third' },
{ id: 4, text: 'fourth' },
{ id: 5, text: 'fifth' }
];