Skip to content

Commit ef5603e

Browse files
committed
refactor(tooltip): ♻️ update types for state
1 parent 1239aa3 commit ef5603e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/tooltip/TooltipWrapper.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ import { TooltipUIProps } from "./TooltipProps";
1313

1414
export const useTooltipWrapper = createHook<TooltipWrapperOptions>(
1515
({ state, content, withArrow, prefix, suffix, isDragging, ...props }) => {
16+
if (!state) return props;
17+
1618
const theme = useTheme("tooltip");
1719
const className = tcm(theme.content, props.className);
1820

1921
props = { ...props, className };
22+
2023
props = useTooltip({ state, ...props });
2124
return props;
2225
},
@@ -27,7 +30,10 @@ export const TooltipWrapper = createComponent<TooltipWrapperOptions>(props => {
2730
return createElement("div", htmlProps);
2831
});
2932

30-
export type TooltipWrapperOptions<T extends As = "div"> = TooltipOptions<T> &
33+
export type TooltipWrapperOptions<T extends As = "div"> = Omit<
34+
TooltipOptions<T>,
35+
"state"
36+
> &
3137
Partial<TooltipUIProps> & {};
3238

3339
export type TooltipWrapperProps<T extends As = "div"> = Props<

0 commit comments

Comments
 (0)