Skip to content

Commit

Permalink
check for post
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Apr 20, 2017
1 parent fae4457 commit 8733085
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion blog/src/components/posts_show.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ class PostsShow extends Component {
}

render() {
const { post } = this.props;

if (!post) {
return <div>Loading...</div>;
}

return (
<div>
Posts Show!
<h3>{post.title}</h3>
<h6>Categories: {post.categories}</h6>
<p>{post.content}</p>
</div>
);
}
Expand Down

0 comments on commit 8733085

Please sign in to comment.