๋ฏธ๋ ํ๋ก์ ํธ์์ map์ ์์๋ฅผ ์ ์ฐพ์ง ๋ชปํ๋์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค
import React from "react"; import styled from "styled-components"; import CommentListItem from "./CommentListItem"; const Wrapper = styled.div` display: flex; flex-direction: column; align-item: flex-start; justify-content: center; & > * { :not(:last-child){ margin-bottom: 16px; } } `; function CommentList(props){ const { comments } = props; return ( {comments && comments.map((comment, index) => { return })} ); } export default CommentList;์์ ๊ฐ์ด ์์ ํ์ฌ ๊ณ ์ณค์ต๋๋ค.data๊ฐ ๋ถ๋ฌ๋ค๋ ๊ฒ๋ณด๋ค ๋ธ๋ผ์ฐ์ ์์ ํ์ผ์ ์ฝ๋ ๊ฒ์ด ๋น ๋ผ์ ๋ฐ์ํ ์ค๋ฅ๋ผ๊ณ ํด์ ์์ ๊ฐ์ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ์ต๋๋ค.์ง๋ฌธ์ ๋ต๋ณํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค:)