Last active
April 10, 2017 21:55
-
-
Save domyen/fb2f276194c79f13891afab05966443d to your computer and use it in GitHub Desktop.
Presentational component example (via @chantastic)
Raw
CommentList.jsx
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
Show hidden characters
// CommentList.jsx (PRESENTATION) | |
class CommentList extends React.Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
return <ul> {this.props.comments.map(renderComment)} </ul>; | |
} | |
renderComment({avatar, author, body}) { | |
return <li>{avatar} {author} {body}</li>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment