Files
SCM-Manager/scm-ui/src/changesets/components/DropDown.js

26 lines
484 B
JavaScript
Raw Normal View History

2018-09-17 14:01:51 +02:00
// @flow
import React from "react";
type Props = {
options: string[],
optionSelected: string => void
}
class DropDown extends React.Component<Props> {
render() {
const {options} = this.props;
return <select onChange={this.change}>
{options.map(option => {
return <option key={option} value={option}>{option}</option>
})}
</select>
}
change = (event) => {
this.props.optionSelected(event.target.value);
}
}
export default DropDown;