Skip to content

Instantly share code, notes, and snippets.

@doug2k1
Created September 28, 2016 03:51
Show Gist options
  • Save doug2k1/c1b11f7dc7ae8052cd5daa976941f989 to your computer and use it in GitHub Desktop.
Save doug2k1/c1b11f7dc7ae8052cd5daa976941f989 to your computer and use it in GitHub Desktop.
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