import React, { ChangeEvent } from "react"; import classNames from "classnames"; type Props = { options: string[]; optionValues?: string[]; optionSelected: (p: string) => void; preselectedOption?: string; className: string; disabled?: boolean; }; class DropDown extends React.Component { render() { const { options, optionValues, preselectedOption, className, disabled } = this.props; if (preselectedOption && !options.includes(preselectedOption)) { options.unshift(preselectedOption); } return (
); } change = (event: ChangeEvent) => { this.props.optionSelected(event.target.value); }; } export default DropDown;