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
Loading...
}
return
}
}
// 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)