How to get the selected value onChange of reduce redux-form drop down

im using a reduction reaction form. Fields and I have drop classes. I can select any class from the drop-down list. but the problem is that when I ever select any value (class) from the drop-down list, I want to call the onChange action. when I run the action with the change change drop-down values, it doesnโ€™t install and does not display the selected value. im using the following lines of code

<Field name="class._id" component="select" className="form-control" onChange={this.onChange.bind(this)} >
              <option value="">Select class...</option>
              {this.props.classes.map(Class =>
              <option value={Class._id} key={Class._id} >{Class.name}</option>)}
</Field>

here is the onChange function

 onChange(){
     console.log(" Triggered")
  }

If I do not set the onChange event, then my drop-down menu performs the correction and correctly displays the selected value with the correct text. but I want to call a function whenever you select any value

+4
2

, , ( - ) JSBin Fiddle? SO , . , , . :

onChange(event) {
  console.log(event.target.value);
}

?

+4

, prop of redux html?

const {fields} = this.props
<select {...fields.class} onChange={this.handleChange}>
...

handleChange(event) {
    // do your stuff
    this.props.fields.class.onChange(event)
}
0

Source: https://habr.com/ru/post/1649151/


All Articles