Converter
Converter copied to clipboard
Unable to create Slinky component for antd Select
Version 4.22.3 of antd has:
declare const Select: (<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>(props: SelectProps<ValueType, OptionType> & {
children?: React.ReactNode;
} & {
ref?: React.Ref<BaseSelectRef> | undefined;
}) => React.ReactElement) & {
SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
Option: typeof Option;
OptGroup: typeof OptGroup;
};
This fails to be converted to a Slink component.
See https://github.com/ScalablyTyped/SlinkyDemos/pull/47
There are 2 problems:
- The second
OptionTypetype parameter - The outer intersection
This works:
declare const SelectRef: (<ValueType = any>(props: SelectProps<ValueType> & {
children?: React.ReactNode;
} & {
ref?: React.Ref<BaseSelectRef> | undefined;
}) => React.ReactElement);
declare type InternalSelectType = typeof SelectRef;
interface SelectInterface extends InternalSelectType {
SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
Option: typeof Option;
OptGroup: typeof OptGroup;
}
declare const Select: SelectInterface;
this might have been fixed with beta41. at least the japgolly select component reappeared for me again.