Skip to content

Commit

Permalink
Merge pull request #248 from element-hq/midhun/fix-prop-type
Browse files Browse the repository at this point in the history
Use XOR for `TooltipProps`
  • Loading branch information
MidhunSureshR authored Sep 23, 2024
2 parents 8623416 + 3b4de90 commit 7662d57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ import {
TooltipLabel,
useTooltip,
} from "./useTooltip";
import { XOR } from "ts-xor";

// Unfortunately Omit doesn't distribute nicely over sum types, so we have to
// piece together the useTooltip options type by hand
type TooltipProps = Omit<CommonUseTooltipProps, "isTriggerInteractive"> &
(TooltipLabel | TooltipDescription) & {
XOR<TooltipLabel, TooltipDescription> & {
/**
* Whether the trigger element is interactive.
* When trigger is interactive:
Expand Down

0 comments on commit 7662d57

Please sign in to comment.