I try to attach event handler to react bootstrap select component bootstrap select component.
class MyComponent extends React.Component {
constructor(props) {
super();
this.state = {
value: 'initial'
};
}
handleSelect(value) {
console.log(value);
this.setState({
value: value
});
}
render() {
return (
<div>
<div> selected value { this.state.value }</div>
<FormControl
componentClass="select"
placeholder="select"
onChange={this.handleSelect.bind(this)}
>
<option value="test" eventKey="select">select</option>
<option value="asdas" eventKey="other">...</option>
</FormControl>
</div>
);
}
}
but in handleSelectinstead of clicked option value I get some Proxy object.
Here is CodePen showing the problem.
What is the proper way of attaching handlers to FormControl?