Skip to content

Instantly share code, notes, and snippets.

@astrotim astrotim/Post.js.diff
Last active Dec 29, 2017

Embed
What would you like to do?
update Post.js to render content
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
You can’t perform that action at this time.