I have 3 select like this
const { selectedOption , selectedOption2, selectedOption3} = this.state;
const value = selectedOption && selectedOption.value;
const value2 = selectedOption2 && selectedOption2.value;
const value3 = selectedOption3 && selectedOption3.value;
<Select
name="form-field-name1"
value={value}
onChange={this.handleChange}
options={[
{ value: 'Ados et jeunes', label: 'One' },
{ value: 'Pêche à la truite', label: 'Two' },
]}
/>
<Select
name="form-field-name2"
value={value2}
onChange={this.handleChange}
options={[
{ value: 'XXXX', label: 'OneX' },
{ value: 'XXXXXX', label: 'TwoX' },
]}
/>
<Select
name="form-field-name3"
value={value3}
onChange={this.handleChange}
options={[
{ value: 'rrrrrr', label: 'Oner' },
{ value: 'rrrrrrrr', label: 'Twor' },
]}
/>
and when i don't know how to change the value with handlechange
handleChange(selectedOption) {
this.setState({ selectedOption });
console.log(`Selected: ${selectedOption.label}`);
}
how can i update selectoption 2 and 3 in the same function