fix: type incompatibility in strict mode (#36189)

* fix: type incompatibility

* fix: type
This commit is contained in:
Dunqing 2022-06-23 12:17:05 +08:00 committed by GitHub
parent 88415f45e1
commit 3ea2817549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -44,6 +44,7 @@ export interface TreeSelectProps<
| 'getInputElement'
| 'backfill'
| 'treeLine'
| 'switcherIcon'
> {
suffixIcon?: React.ReactNode;
size?: SizeType;
@ -52,7 +53,7 @@ export interface TreeSelectProps<
bordered?: boolean;
treeLine?: TreeProps['showLine'];
status?: InputStatus;
switcherIcon?: SwitcherIcon;
switcherIcon?: SwitcherIcon | RcTreeSelectProps<ValueType, OptionType>['switcherIcon'];
}
const InternalTreeSelect = <OptionType extends BaseOptionType | DefaultOptionType = BaseOptionType>(

View File

@ -102,7 +102,10 @@ interface DraggableConfig {
}
export interface TreeProps<T extends BasicDataNode = DataNode>
extends Omit<RcTreeProps<T>, 'prefixCls' | 'showLine' | 'direction' | 'draggable'> {
extends Omit<
RcTreeProps<T>,
'prefixCls' | 'showLine' | 'direction' | 'draggable' | 'icon' | 'switcherIcon'
> {
showLine?: boolean | { showLeafIcon: boolean };
className?: string;
/** 是否支持多选 */
@ -139,8 +142,11 @@ export interface TreeProps<T extends BasicDataNode = DataNode>
draggable?: DraggableFn | boolean | DraggableConfig;
style?: React.CSSProperties;
showIcon?: boolean;
icon?: ((nodeProps: AntdTreeNodeAttribute) => React.ReactNode) | React.ReactNode;
switcherIcon?: SwitcherIcon;
icon?:
| ((nodeProps: AntdTreeNodeAttribute) => React.ReactNode)
| React.ReactNode
| RcTreeProps<T>['icon'];
switcherIcon?: SwitcherIcon | RcTreeProps<T>['switcherIcon'];
prefixCls?: string;
children?: React.ReactNode;
blockNode?: boolean;