(= 태그에 key 속성을 부여하는 이유)
commentInput = (e) => {
if (e !== "") {
this.setState({
commentList: this.state.commentList.concat(e),
commentValue: "",
});
}
};
<ul>
{this.state.commentList.map((comment) => (
<li key={comment.id}>
{comment.content}
<Comment commentRemove={() => this.handleRemove(comment)} />
</li>
))}
</ul>
...배열