Skip to content

Instantly share code, notes, and snippets.

@aofleejay
Last active May 30, 2018 17:46
Show Gist options
  • Save aofleejay/34bf1a17a4a1ccaadfbe5be67a75b5f5 to your computer and use it in GitHub Desktop.
Save aofleejay/34bf1a17a4a1ccaadfbe5be67a75b5f5 to your computer and use it in GitHub Desktop.
<CommentList />
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