Skip to content

Instantly share code, notes, and snippets.

@hrumhrumble
Created September 26, 2017 09:33
Show Gist options
  • Save hrumhrumble/fa9be32c050a2a641520300c6b2416be to your computer and use it in GitHub Desktop.
Save hrumhrumble/fa9be32c050a2a641520300c6b2416be to your computer and use it in GitHub Desktop.
import React, {Component} from 'react'
import Comment from './Comment'
class CommentList extends Component {
render(){
const {comments} = this.props
const commentList = comments.map((comment) => <li key={comment.id}>
<Comment comment={comment} />
</li>)
return (
<div>
<h2>Comments</h2>
<ul>
{commentList}
</ul>
</div>
)
}
}
export default CommentList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment