I am trying to call a function from onChange event of <select> tag.
<select id="select-option" onChange = {() => this.props.onPressed(this.value)}>
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
I want to pass the value of the <option> to onPressed() function. How can I do it?
>Solution :
Get the value from the event’s target instead.
onChange={e => this.props.onPressed(e.target.value)}