tooltip
tooltip copied to clipboard
Incorrect typing for trigger prop -- should be ActionType | ActionType[]
According to rc-trigger > src > index.tsx, the action
prop should allow an ActionType
or an ActionType[]
:
export interface TriggerProps {
children: React.ReactElement;
action?: ActionType | ActionType[];
However, the trigger
prop of rc-tooltip, which gets passed to the action
prop of rc-trigger, only allows a single ActionType
(not an array). Here is the relevant code from rc-tooltip > src > Tooltip.tsx:
export interface TooltipProps extends Pick<TriggerProps, 'onPopupAlign' | 'builtinPlacements'> {
trigger?: ActionType;
// ...
return (
<Trigger
popupClassName={overlayClassName}
prefixCls={prefixCls}
popup={getPopupElement}
action={trigger}
(Note: I came across this problem via Ant Design's Tooltip
component, which depends on rc-tooltip.)
👍