Created
January 10, 2016 01:44
-
-
Save otang/2ab4a88d6bf4e2df1af9 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
ChildComponent = React.createClass({ | |
render: function() { | |
return ( | |
<button onClick={this.props.onClick} /> | |
); | |
} | |
}); | |
Playlist = React.createClass({ | |
handleClickSong: function(song) { | |
console.log('A song in a child component was clicked'); | |
this.setState({selectedSong: song}); | |
}, | |
render: function() { | |
return ( | |
<ChildComponent onClick={this.handleClickSong} /> | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment