mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-01 21:37:06 +08:00
chore(tree-select): improve code style by restProps (#50314)
This commit is contained in:
parent
dd3bfae425
commit
426082dfc1
@ -89,7 +89,10 @@ const InternalTreeSelect = <
|
|||||||
ValueType = any,
|
ValueType = any,
|
||||||
OptionType extends BaseOptionType | DefaultOptionType = BaseOptionType,
|
OptionType extends BaseOptionType | DefaultOptionType = BaseOptionType,
|
||||||
>(
|
>(
|
||||||
{
|
props: TreeSelectProps<ValueType, OptionType>,
|
||||||
|
ref: React.Ref<BaseSelectRef>,
|
||||||
|
) => {
|
||||||
|
const {
|
||||||
prefixCls: customizePrefixCls,
|
prefixCls: customizePrefixCls,
|
||||||
size: customizeSize,
|
size: customizeSize,
|
||||||
disabled: customDisabled,
|
disabled: customDisabled,
|
||||||
@ -119,10 +122,8 @@ const InternalTreeSelect = <
|
|||||||
variant: customVariant,
|
variant: customVariant,
|
||||||
dropdownStyle,
|
dropdownStyle,
|
||||||
tagRender,
|
tagRender,
|
||||||
...props
|
...restProps
|
||||||
}: TreeSelectProps<ValueType, OptionType>,
|
} = props;
|
||||||
ref: React.Ref<BaseSelectRef>,
|
|
||||||
) => {
|
|
||||||
const {
|
const {
|
||||||
getPopupContainer: getContextPopupContainer,
|
getPopupContainer: getContextPopupContainer,
|
||||||
getPrefixCls,
|
getPrefixCls,
|
||||||
@ -203,7 +204,7 @@ const InternalTreeSelect = <
|
|||||||
|
|
||||||
// ===================== Icons =====================
|
// ===================== Icons =====================
|
||||||
const { suffixIcon, removeIcon, clearIcon } = useIcons({
|
const { suffixIcon, removeIcon, clearIcon } = useIcons({
|
||||||
...props,
|
...restProps,
|
||||||
multiple: isMultiple,
|
multiple: isMultiple,
|
||||||
showSuffixIcon,
|
showSuffixIcon,
|
||||||
hasFeedback,
|
hasFeedback,
|
||||||
@ -223,7 +224,7 @@ const InternalTreeSelect = <
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ==================== Render =====================
|
// ==================== Render =====================
|
||||||
const selectProps = omit(props, [
|
const selectProps = omit(restProps, [
|
||||||
'suffixIcon',
|
'suffixIcon',
|
||||||
'removeIcon',
|
'removeIcon',
|
||||||
'clearIcon',
|
'clearIcon',
|
||||||
|
Loading…
Reference in New Issue
Block a user