Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created August 10, 2018 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/75ee7685c185f062e7daf8143b2ce8e8 to your computer and use it in GitHub Desktop.
Save dance2die/75ee7685c185f062e7daf8143b2ce8e8 to your computer and use it in GitHub Desktop.
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