Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/components/TooltipController/TooltipController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,18 @@ const TooltipController = ({
}, [anchorRefs, providerActiveAnchor, activeAnchor, anchorId, anchorSelect])

/**
* content priority: children < renderContent or content < html
* content priority: children < render or content < html
* children should be lower priority so that it can be used as the "default" content
*/
let renderedContent: ChildrenType = children
const contentWrapperRef = useRef<HTMLDivElement>(null)
if (render) {
renderedContent = (
const rendered = render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode
renderedContent = rendered ? (
<div ref={contentWrapperRef} className="react-tooltip-content-wrapper">
{render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode}
{rendered}
</div>
)
) : null
} else if (tooltipContent) {
renderedContent = tooltipContent
}
Expand Down