add dropdown component

This commit is contained in:
frab1t 2019-05-08 16:17:26 +02:00
parent 39f5fb503c
commit 164c055e7c
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
import React, { Component } from 'react';
import { Input } from 'reactstrap';
class DropDown extends Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
let options = this.props.options;
options = options.map((opt) => {
return <option key={opt.id} value={opt.id}>{opt.value}</option>
});
console.log('reh');
return(
<Input
name = "type"
type = "select"
value = { this.props.type }
onChange = { this.props.handleInputChange }
>
<option value="">---</option>
{ options }
</Input>
);
}
}
export default DropDown;