Fixing some issues with retrieving posts

This commit is contained in:
2019-10-29 14:28:53 -04:00
parent 2fc37e3e34
commit 7341de742e
3 changed files with 9 additions and 7 deletions

View File

@@ -94,13 +94,13 @@ class user extends Component {
) : (<p> loading topics...</p>);
let recentPostsMarkup = this.state.posts ? (
this.state.posts.map(post => <Posts post={post}/>)
this.state.posts.map(post => <Posts key={post.createdAt} post={post}/>)
) : ( <p> Loading... </p> );
return (
<Grid container spacing={16}>
<Grid item sm={8} xs={12}>
<p>Post</p>
{recentPostsMarkup}
</Grid>
<Grid item sm={4} xs={12}>
<img src={noImage}/>