Created
September 28, 2016 03:51
-
-
Save doug2k1/c1b11f7dc7ae8052cd5daa976941f989 to your computer and use it in GitHub Desktop.
This file contains 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
class UserListContainer extends React.Component { | |
constructor () { | |
super(); | |
this.state = { | |
users: [] | |
}; | |
} | |
componentDidMount () { | |
fetch('/users').then(users => { | |
this.setState({ users }); | |
}); | |
} | |
render () { | |
return ( | |
<UserList users={this.state.users} /> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment