-
-
Save hrumhrumble/fa9be32c050a2a641520300c6b2416be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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