Skip to content

Commit 9bbdafe

Browse files
authored
fix(tooltip): type children prop (#330)
1 parent 9d9be52 commit 9bbdafe

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/Tooltip/Tooltip.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { PropsWithChildren } from 'react';
21
import * as React from 'react';
32
import styled, { keyframes } from 'styled-components';
43
import { usePopper } from 'react-popper';
54
import { Placement } from '@popperjs/core/lib/enums';
65
import { variant } from 'styled-system';
6+
7+
import type { PropsWithChildren } from 'react';
8+
79
import { MediaQueries, SemanticColors } from '../../essentials';
810
import { get } from '../../utils/themeGet';
911
import { Text } from '../Text/Text';
@@ -138,13 +140,13 @@ interface TooltipProps {
138140
alwaysVisible?: boolean;
139141
}
140142

141-
const Tooltip: React.FC<TooltipProps> = ({
143+
const Tooltip: React.FC<PropsWithChildren<TooltipProps>> = ({
142144
content,
143145
children,
144146
placement = 'top',
145147
alwaysVisible = false,
146148
inverted = false
147-
}: PropsWithChildren<TooltipProps>) => {
149+
}) => {
148150
const [isVisible, setIsVisible] = React.useState(alwaysVisible);
149151
/**
150152
* triggerReference and contentReference are used with the Popper library in order to get the tooltip styles and attributes

0 commit comments

Comments
 (0)