Skip to content

Commit a5c8201

Browse files
committed
fix type
1 parent 21d7795 commit a5c8201

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/TreeSelect.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { BaseSelectProps, BaseSelectPropsWithoutPrivate, BaseSelectRef } from 'rc-select';
1+
import type { BaseSelectPropsWithoutPrivate, BaseSelectRef } from 'rc-select';
22
import { BaseSelect } from 'rc-select';
33
import useId from 'rc-select/lib/hooks/useId';
44
import type { IconType } from 'rc-tree/lib/interface';
@@ -212,7 +212,7 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
212212
postState: search => search || '',
213213
});
214214

215-
const onInternalSearch: BaseSelectProps['onSearch'] = searchText => {
215+
const onInternalSearch = searchText => {
216216
setSearchValue(searchText);
217217
onSearch?.(searchText);
218218
};
@@ -581,21 +581,19 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
581581
);
582582

583583
// ====================== Display Change ========================
584-
const onDisplayValuesChange = useRefFunc<BaseSelectProps['onDisplayValuesChange']>(
585-
(newValues, info) => {
586-
const newRawValues = newValues.map(item => item.value);
584+
const onDisplayValuesChange = useRefFunc((newValues, info) => {
585+
const newRawValues = newValues.map(item => item.value);
587586

588-
if (info.type === 'clear') {
589-
triggerChange(newRawValues, {}, 'selection');
590-
return;
591-
}
587+
if (info.type === 'clear') {
588+
triggerChange(newRawValues, {}, 'selection');
589+
return;
590+
}
592591

593-
// TreeSelect only have multiple mode which means display change only has remove
594-
if (info.values.length) {
595-
onOptionSelect(info.values[0].value, { selected: false, source: 'selection' });
596-
}
597-
},
598-
);
592+
// TreeSelect only have multiple mode which means display change only has remove
593+
if (info.values.length) {
594+
onOptionSelect(info.values[0].value, { selected: false, source: 'selection' });
595+
}
596+
});
599597

600598
// ========================== Context ===========================
601599
const treeSelectContext = React.useMemo<TreeSelectContextProps>(

0 commit comments

Comments
 (0)