MyCrypto/common/components/ui/SimpleSelect.tsx
HenryNguyen5 f39787152e Fix Miscellaneous Types (#635)
* Add repo wide prettier command to prepush

* Make config file explict, remove formatAll to prepush

* Fix react router typings

* Add more typings

* Fix event typings,  fix transition children
2017-12-19 16:46:34 -06:00

28 lines
616 B
TypeScript

import React, { Component } from 'react';
interface Props {
value?: string;
options: string[];
onChange(event: React.FormEvent<HTMLSpanElement>): void;
}
export default class SimpleSelect extends Component<Props, {}> {
public render() {
return (
<select
value={this.props.value || this.props.options[0]}
className={'form-control'}
onChange={this.props.onChange}
>
{this.props.options.map((obj, i) => {
return (
<option value={obj} key={i}>
{obj}
</option>
);
})}
</select>
);
}
}