Fix Select onChange prop

Summary: Was passing in a Proxy instance before instead of a string. Now it passes the correct string that callers would expect.

Reviewed By: sjkirby

Differential Revision: D10181911

fbshipit-source-id: 8dfa677479a81de0f7b5be23f827ce7b52169931
This commit is contained in:
Hilal Alsibai
2018-10-03 16:51:36 -07:00
committed by Facebook Github Bot
parent a54b542d17
commit 490f5e7f5a

View File

@@ -15,11 +15,15 @@ export default class Select extends Component<{
onChange: (key: string) => void,
selected?: ?string,
}> {
onChange = (event: Object) => {
this.props.onChange(event.target.value);
};
render() {
const {className, options, selected} = this.props;
return (
<select onChange={this.props.onChange} className={className}>
<select onChange={this.onChange} className={className}>
{Object.keys(options).map(key => (
<option selected={key === selected}>{options[key]}</option>
))}