chore: code style optimization (#43865)

This commit is contained in:
thinkasany 2023-07-28 12:15:30 +08:00 committed by GitHub
parent a96e1bf04e
commit 3ac6308f2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -5,6 +5,7 @@ import RcTree from 'rc-tree';
import type { DataNode, Key } from 'rc-tree/lib/interface';
import type { Component } from 'react';
import React from 'react';
import type { CSSMotionProps } from 'rc-motion';
import initCollapseMotion from '../_util/motion';
import { ConfigContext } from '../config-provider';
import useStyle from './style';
@ -175,7 +176,7 @@ const Tree = React.forwardRef<RcTree, TreeProps>((props, ref) => {
const prefixCls = getPrefixCls('tree', customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const motion = customMotion ?? {
const motion: CSSMotionProps = customMotion ?? {
...initCollapseMotion(rootPrefixCls),
motionAppear: false,
};

View File

@ -74,7 +74,7 @@ type WalkingState =
| typeof DONE_WITH_ELLIPSIS
| typeof DONE_WITHOUT_ELLIPSIS;
const Ellipsis = ({
const Ellipsis: React.FC<EllipsisProps> = ({
enabledMeasure,
children,
text,
@ -82,7 +82,7 @@ const Ellipsis = ({
fontSize,
rows,
onEllipsis,
}: EllipsisProps) => {
}) => {
const [[startLen, midLen, endLen], setCutLength] = React.useState<
[startLen: number, midLen: number, endLen: number]
>([0, 0, 0]);

View File

@ -9,12 +9,12 @@ export interface EllipsisTooltipProps {
children: React.ReactElement;
}
const EllipsisTooltip = ({
const EllipsisTooltip: React.FC<EllipsisTooltipProps> = ({
enabledEllipsis,
isEllipsis,
children,
tooltipProps,
}: EllipsisTooltipProps) => {
}) => {
if (!tooltipProps?.title || !enabledEllipsis) {
return children;
}