handleChange function "e" parameter


#1


Can some one please explain me how work handleChange function step by step. Why there is "e" parameter in this function, and why when we call this function inside we use no parameters.
Thx,


var Child = React.createClass({
  handleChange: function(e) {
    var name = e.target.value;
    this.props.onChange(name);
  },

<select id="great-names" onChange={this.handleChange}>


#2

This is an event, which when it occurs will pass the EventObject to the handler via the provided variable (parameter), e. We could name it anything, but e is very commonly used to signify event object. The object is transient and only remains in memory until the next event is triggered. Its properties are all the details and methods applicable.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.