I am going through the react tutorial on codecademy
and have reached the reactjs part 2 course.
I have reached the part where one component changes the name
and other component displays it.
the handlechange function below is supposed to select the name and pass it to the parent function
BUt I am not really sure how this works.
could any of you guys help me understand the below code?
here’s the link to the page in case you want to check the other components too
not sure though if this link will work for you - i mean if you need to be signed in or something to see the link.
var Child = React.createClass({
handleChange: function(e) {
var name = e.target.value;
this.props.onChange(name);
},
<select id="great-names" onChange={this.handleChange}>