diff --git a/src/components/TooltipController/TooltipController.tsx b/src/components/TooltipController/TooltipController.tsx index 7a176e25..41a850fb 100644 --- a/src/components/TooltipController/TooltipController.tsx +++ b/src/components/TooltipController/TooltipController.tsx @@ -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(null) if (render) { - renderedContent = ( + const rendered = render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode + renderedContent = rendered ? (
- {render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode} + {rendered}
- ) + ) : null } else if (tooltipContent) { renderedContent = tooltipContent }