Skip to content

Commit

Permalink
fix: render non-string content outside of the Text element
Browse files Browse the repository at this point in the history
  • Loading branch information
evanfrawley committed Aug 5, 2024
1 parent e500aac commit 7c3d946
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/radix-ui-themes/src/components/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ const Tooltip = React.forwardRef<TooltipElement, TooltipProps>((props, forwarded
ref={forwardedRef}
className={classNames('rt-TooltipContent', className)}
>
<Text as="p" className="rt-TooltipText" size="1">
{content}
</Text>
{typeof content === 'string' ? (
<Text as="p" className="rt-TooltipText" size="1">
{content}
</Text>
) : (
<>{content}</>
)}
<TooltipPrimitive.Arrow className="rt-TooltipArrow" />
</TooltipPrimitive.Content>
</Theme>
Expand Down

0 comments on commit 7c3d946

Please sign in to comment.