Skip to content

Instantly share code, notes, and snippets.

@manoelneto
Last active October 6, 2018 13:43
Show Gist options
  • Save manoelneto/1b407311a62a27eda581da6697be2235 to your computer and use it in GitHub Desktop.
Save manoelneto/1b407311a62a27eda581da6697be2235 to your computer and use it in GitHub Desktop.
const PostList = ({posts}) => (
posts.map(post => <Post post={post} />)
)
class PostPage extends Component {
state = {
posts: []
}
componentDidMount() {
fetchPost().then(posts => this.setState({posts}))
}
render() {
return <PostList posts={this.state.posts}>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment