diff --git a/src/renderer/components/select/select.tsx b/src/renderer/components/select/select.tsx index 7ae1dcbde5..92516d2cd6 100644 --- a/src/renderer/components/select/select.tsx +++ b/src/renderer/components/select/select.tsx @@ -12,18 +12,21 @@ import { themeStore } from "../../theme.store"; const { Menu } = components; +type OptionType = { label: string; value: string }; +type GroupType = GroupTypeBase; + export interface GroupSelectOption { label: ReactNode; options: T[]; } export interface SelectOption { - value: T; + value?: T; label?: React.ReactNode; } -export interface SelectProps extends ReactSelectProps> { - options?: readonly any[]; +export interface SelectProps extends ReactSelectProps { + options?: ReadonlyArray; value?: T; themeName?: "dark" | "light" | "outlined"; menuClass?: string; @@ -70,15 +73,9 @@ export class Select extends React.Component { } @computed get options(): readonly SelectOption[] { - const { autoConvertOptions, options } = this.props; - - if (autoConvertOptions && Array.isArray(options)) { - return options.map(opt => { - return this.isValidOption(opt) ? opt : { value: opt, label: String(opt) }; - }); - } - - return options; + return this.props.options.map(opt => { + return this.isValidOption(opt) ? opt : { value: opt, label: String(opt) }; + }); } @autobind()