zzangCS / zzangNext1

유데미 next 강의 따라가보쟈!
0 stars 0 forks source link

props 객체는 배열인가? #1

Closed smarfy99 closed 1 year ago

smarfy99 commented 1 year ago
const EventList = (props) => {
  const { items } = props;
  return (
    <>
      <ul>
        {/* props 객체는 배열이다 */}
        {items.map((event) => (
          <EventItem
            key={event.id}
            id={event.id}
            title={event.title}
            location={event.location}
            date={event.date}
            image={event.image}
          />
        ))}
      </ul>
    </>
  );
};

export default EventList;
smarfy99 commented 1 year ago
image

콘솔 찍어보니 items는 랜딩페이지에서 event-list가 나올때 있는 모든 객체의 배열이었음.