Last active
October 6, 2018 13:43
-
-
Save manoelneto/1b407311a62a27eda581da6697be2235 to your computer and use it in GitHub Desktop.
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
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