Closed giogonzo closed 5 years ago
Project card
There are probably multiple issues: one is for sure that we are not currently exporting the correctly "defaulted" props. For this, an initial solution could be:
type DefaultProps = { delimiter: NonNullable<SelectNS.Props["delimiter"]>; size: "medium" | "small"; isSearchable: NonNullable<SelectNS.Props["isSearchable"]>; menuPlacement: NonNullable<SelectNS.Props["menuPlacement"]>; allowCreate: false }; type InternalProps<OptionType> = ObjectOmit< SelectNS.Props<OptionType>, "isMulti" | "isClearable" | "onChange" | "value" > & DefaultProps & { flat?: boolean; innerRef?: (ref: Select<OptionType> | null) => void; } & ( | { type: "multi" | "multi-clearable"; value: OptionType[]; onChange: (value: OptionType[]) => void; } | { type: "single"; value: OptionType | null; onChange: (value: OptionType) => void; } | { type: "single-clearable"; value: OptionType | null; onChange: (value: OptionType | null) => void; }) & ( | ({ allowCreate: true; isSearchable?: never; } & CreatableProps<OptionType>) | { allowCreate?: never; }); export class Dropdown<OptionType> extends React.Component< InternalProps<OptionType> > { ... } export namespace Dropdown { export type Props<T> = ObjectOmit<InternalProps<T>, keyof DefaultProps> & Partial<DefaultProps> }
But this in turn is causing issues (e.g. in DropdownField)
DropdownField
Project card
There are probably multiple issues: one is for sure that we are not currently exporting the correctly "defaulted" props. For this, an initial solution could be:
But this in turn is causing issues (e.g. in
DropdownField
)