Last active
September 4, 2019 09:26
-
-
Save JakeGinnivan/81392472cf0d57bb30a5f24a70112f0f to your computer and use it in GitHub Desktop.
Revisions
-
JakeGinnivan revised this gist
Sep 4, 2019 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ class SomethingComponent extends React.Component { componentWillMount() { // If we don't have an article, load it -
JakeGinnivan renamed this gist
Sep 4, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
JakeGinnivan created this gist
Sep 4, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ jsx class SomethingComponent extends React.Component { componentWillMount() { // If we don't have an article, load it if (!this.props.article) { this.props.dispatch(loadArticle(this.props.id)) } } render() { if (this.props.loading) { return <div>Loading...</div> } return <Article article={this.props.article} /> } } // For this example, we only have a single state tree // so no need to use mapStateToProps to narrow the data // we are connecting to export default connect(state => state)(SomethingComponent)