Last active
May 30, 2018 17:46
-
-
Save aofleejay/34bf1a17a4a1ccaadfbe5be67a75b5f5 to your computer and use it in GitHub Desktop.
<CommentList />
Raw
CommentList.js
This file contains hidden or 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 Loading from './Loading' | |
class CommentList extends Component { | |
render() { | |
const { isLoading, comments } = this.props | |
if (isLoading) return <Loading /> | |
return ( | |
<ul> | |
{ | |
comments.map(({ id, body }) => <li key={id}>{body}</li>) | |
} | |
</ul> | |
) | |
} | |
} | |
export default CommentList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment