Skip to content

Instantly share code, notes, and snippets.

@Chalarangelo
Created October 31, 2017 12:43
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 Chalarangelo/483ee340fad2fc867d355a22273aa1d8 to your computer and use it in GitHub Desktop.
Save Chalarangelo/483ee340fad2fc867d355a22273aa1d8 to your computer and use it in GitHub Desktop.
let posts = '', postLinks = '';
if(this.state.posts && this.state.posts.data){
posts = this.state.posts.data.map(post => {return <Post post={post} key={"post_"+post.id}/>;});
postLinks = this.state.posts.data.map(post => {return <a href={"#"+post.id} key={"post_link_"+post.id} className="button">{post.title}</a>})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment