Created
August 10, 2018 02:17
-
-
Save dance2die/75ee7685c185f062e7daf8143b2ce8e8 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
render() { | |
const { posts, isBottomReached } = this.state; | |
const postComponents = posts.map((post, i) => ( | |
<RedditPost key={post.id} post={post} order={i + 1} /> | |
)); | |
return ( | |
<div className="App"> | |
{postComponents} | |
{isBottomReached ? null : ( | |
<button className="loadMoreButton" onClick={this.loadMoreStories}> | |
Load More Stories | |
</button> | |
)} | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment