Reactjs – How to get multiple selected options value in React JS


<Multiselect label='Select College' ref="collegeList" onChange={this.handleChange} multiple >
         <option value='college1'>college1</option>
         <option value='college2'>college2</option>

This component is from

What should be written inside the handleChange() function ?

Best Solution

Here's a much cleaner, es6 way to do it :)

let selected = []
  .filter(option => option.selected)
  .map(option => option.value)

There you go, all of the selected options!