Last active
May 30, 2018 17:50
-
-
Save aofleejay/aa094db354cdcc889994ea433fa737d6 to your computer and use it in GitHub Desktop.
<CommentList /> with HOC
Raw
CommentList.js
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
import React, { Component } from 'react' | |
import withLoading from '../hocs/withLoading' | |
class CommentList extends Component { | |
render() { | |
return ( | |
<ul> | |
{ | |
this.props.comments.map(({ id, body }) => <li key={id}>{body}</li>) | |
} | |
</ul> | |
) | |
} | |
} | |
export default withLoading(CommentList) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment