Skip to content

Commit b354862

Browse files
shaodahongzombieJ
authored andcommitted
fix: ts type (#197)
* fix: ts type fix type * resort code
1 parent 50d8d7e commit b354862

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
export interface ContentProps {
44
prefixCls?: string;
5-
overlay: (() => React.ReactElement) | React.ReactElement;
5+
overlay: (() => React.ReactNode) | React.ReactNode;
66
id: string;
77
}
88

src/Tooltip.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import React, { useRef, useImperativeHandle, forwardRef } from 'react';
2-
import Trigger from 'rc-trigger';
3-
import { AlignType, AnimationType } from 'rc-trigger/lib/interface';
2+
import Trigger, { TriggerProps } from 'rc-trigger';
3+
import { AlignType, AnimationType, ActionType } from 'rc-trigger/lib/interface';
44
import { placements } from './placements';
55
import Content from './Content';
66

7-
export interface TooltipProps {
8-
trigger?: string[];
7+
export interface TooltipProps extends Pick<TriggerProps, 'onPopupAlign' | 'builtinPlacements'> {
8+
trigger?: ActionType;
99
defaultVisible?: boolean;
1010
visible?: boolean;
1111
placement?: string;
1212
transitionName?: string;
1313
animation?: AnimationType;
14-
onVisibleChange?: () => void;
14+
onVisibleChange?: (visible: boolean) => void;
1515
afterVisibleChange?: () => void;
16-
overlay: (() => React.ReactElement) | React.ReactElement;
16+
overlay: (() => React.ReactNode) | React.ReactNode;
1717
overlayStyle?: React.CSSProperties;
1818
overlayClassName?: string;
1919
prefixCls?: string;

0 commit comments

Comments
 (0)