Last active
September 28, 2016 04:00
-
-
Save doug2k1/9a7e260c96ffcb2777a85b4bbfc1d057 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 { | |
... | |
toggleActive (event) { | |
// event logic | |
} | |
render () { | |
return ( | |
<UserList users={this.state.users} toggleActive={this.toggleActive} /> | |
); | |
} | |
} |
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
const UserList = (props) => { | |
return ( | |
<ul> | |
{props.users.map(user => { | |
return ( | |
<li key={user.id}> | |
<input type="checkbox" onChange={props.toggleActive} /> | |
{user.name} | |
</li> | |
); | |
})} | |
</ul> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment