Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class SomethingComponent extends React.Component {
componentWillMount() {
// If we don't have an article, load it
if (!this.props.article) {
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment