-
Hello, I'm creating a custom Here's a Codesandbox repro. In App.tsx on line 11, you'll see a TS error in my attempt to add polymorphic (forwardRef) types to Tooltip. edit: added clarification |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @binhxn 👋 Nice to see you here 🙂 This isn't working for you because you're trying to extend polymorphism for a part that isn't polymorphic: This usually happens when one of our parts only renders a const Tooltip: React.FC<React.ComponentProps<typeof RadixTooltip.Root>> = ({ children, ...props }) => {
return (
<RadixTooltip.Root delayDuration={200} {...props}>
{children}
</RadixTooltip.Root>
);
}; |
Beta Was this translation helpful? Give feedback.
Hi @binhxn 👋 Nice to see you here 🙂
This isn't working for you because you're trying to extend polymorphism for a part that isn't polymorphic:
This usually happens when one of our parts only renders a
Provider
. So in your case you can get away with just doing something like the following: