Skip to content

Instantly share code, notes, and snippets.

@domyen
Last active April 10, 2017 21:55
Show Gist options
  • Save domyen/fb2f276194c79f13891afab05966443d to your computer and use it in GitHub Desktop.
Save domyen/fb2f276194c79f13891afab05966443d to your computer and use it in GitHub Desktop.
Presentational component example (via @chantastic)
// 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