Skip to content

Creating custom Tooltip.Root component and maintaining types #633

Answered by jjenzz
binhxn asked this question in Help
Discussion options

You must be logged in to vote

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:

const Tooltip: React.FC<React.ComponentProps<typeof RadixTooltip.Root>> = ({ children, ...props }) => {
  return (
    <RadixTooltip.Root delayDuration={200} {...props}>
      {children}
    </RadixTooltip.Root>
  );
};

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@binhxn
Comment options

@mrmartineau
Comment options

Answer selected by binhxn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants