Last active
December 29, 2017 11:20
-
-
Save astrotim/f4447d16b25f8707655f1b31ffb384fa to your computer and use it in GitHub Desktop.
update Post.js to render content
This file contains hidden or 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() { | |
- console.log(this.state.data); | |
- return <p>Post</p>; | |
+ if (!this.state.data) return null; | |
+ | |
+ return ( | |
+ <React.Fragment> | |
+ <h1>{this.state.data.title}</h1> | |
+ {this.state.data.content} | |
+ </React.Fragment> | |
+ ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment