mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
type: improve tree component assert (#49784)
This commit is contained in:
parent
17ad651752
commit
5f09772967
@ -264,10 +264,10 @@ const InternalTreeSelect = <
|
||||
hashId,
|
||||
);
|
||||
|
||||
const renderSwitcherIcon = (nodeProps: AntTreeNodeProps) => (
|
||||
const renderSwitcherIcon: React.FC<AntTreeNodeProps> = (nodeProps) => (
|
||||
<SwitcherIconCom
|
||||
prefixCls={treePrefixCls}
|
||||
switcherIcon={switcherIcon as any}
|
||||
switcherIcon={switcherIcon as SwitcherIcon}
|
||||
treeNodeProps={nodeProps}
|
||||
showLine={treeLine}
|
||||
/>
|
||||
@ -297,8 +297,8 @@ const InternalTreeSelect = <
|
||||
placement={memoizedPlacement}
|
||||
removeIcon={removeIcon}
|
||||
allowClear={mergedAllowClear}
|
||||
switcherIcon={renderSwitcherIcon as any}
|
||||
showTreeIcon={treeIcon as any}
|
||||
switcherIcon={renderSwitcherIcon as RcTreeSelectProps['switcherIcon']}
|
||||
showTreeIcon={treeIcon as boolean}
|
||||
notFoundContent={mergedNotFound}
|
||||
getPopupContainer={getPopupContainer || getContextPopupContainer}
|
||||
treeMotion={null}
|
||||
|
@ -120,7 +120,7 @@ const DirectoryTree: React.ForwardRefRenderFunction<RcTree, DirectoryTreeProps>
|
||||
// const newState: DirectoryTreeState = {};
|
||||
|
||||
// We need wrap this event since some value is not same
|
||||
const newEvent: any = {
|
||||
const newEvent = {
|
||||
...event,
|
||||
selected: true, // Directory selected always true
|
||||
};
|
||||
|
@ -224,10 +224,10 @@ const Tree = React.forwardRef<RcTree, TreeProps>((props, ref) => {
|
||||
return mergedDraggable;
|
||||
}, [draggable]);
|
||||
|
||||
const renderSwitcherIcon = (nodeProps: AntTreeNodeProps) => (
|
||||
const renderSwitcherIcon: React.FC<AntTreeNodeProps> = (nodeProps) => (
|
||||
<SwitcherIconCom
|
||||
prefixCls={prefixCls}
|
||||
switcherIcon={switcherIcon as any}
|
||||
switcherIcon={switcherIcon as SwitcherIcon}
|
||||
treeNodeProps={nodeProps}
|
||||
showLine={showLine}
|
||||
/>
|
||||
@ -258,7 +258,7 @@ const Tree = React.forwardRef<RcTree, TreeProps>((props, ref) => {
|
||||
direction={direction}
|
||||
checkable={checkable ? <span className={`${prefixCls}-checkbox-inner`} /> : checkable}
|
||||
selectable={selectable}
|
||||
switcherIcon={renderSwitcherIcon as any}
|
||||
switcherIcon={renderSwitcherIcon as RcTreeProps['switcherIcon']}
|
||||
draggable={draggableConfig}
|
||||
>
|
||||
{children}
|
||||
|
Loading…
Reference in New Issue
Block a user