Skip to content

Commit

Permalink
Fix(web-react): TooltipTrigger props update
Browse files Browse the repository at this point in the history
- elementType can be now self closing (fe. Icon)
- accepting props from elementType components
  • Loading branch information
pavelklibani committed Feb 2, 2024
1 parent 3b8e153 commit f116536
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/web-react/src/components/Tooltip/TooltipTrigger.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { ElementType, ReactNode } from 'react';
import { useStyleProps } from '../../hooks';
import { StyleProps } from '../../types';
import { StyleProps, TransferProps } from '../../types';
import { useTooltipContext } from './TooltipContext';

interface TooltipTriggerProps extends StyleProps {
interface TooltipTriggerProps extends StyleProps, TransferProps {
elementType?: ElementType | string;
children: string | ReactNode | ((props: { isOpen: boolean }) => React.ReactNode);
children?: string | ReactNode | ((props: { isOpen: boolean }) => React.ReactNode);
}

const TooltipTrigger = (props: TooltipTriggerProps) => {
Expand All @@ -25,6 +25,7 @@ const TooltipTrigger = (props: TooltipTriggerProps) => {

TooltipTrigger.defaultProps = {
elementType: 'button',
children: null,
};

export default TooltipTrigger;

0 comments on commit f116536

Please sign in to comment.