it would be cool if TooltipTrigger and TooltipAnchor had an asChild prop (similar to radix) that would attach the listeners to already existing dom nodes instead of creating a new wrapper div.
currently i have to patch @corvu/tooltip to expose useInternalTooltipContext (since the set{Anchor,Trigger}Ref are only available there. tbh would be nice if they were public too) and do something like this
function TooltipTrigger(props: { children: JSX.Element }) {
const child = resolveFirst(() => props.children)
const context = TooltipPrimitive.useInternalContext()
createEffect(on(child, (child) => {
context.setTriggerRef(child)
}))
return child as unknown as JSX.Element
}
it would be cool if
TooltipTriggerandTooltipAnchorhad anasChildprop (similar to radix) that would attach the listeners to already existing dom nodes instead of creating a new wrapper div.currently i have to patch
@corvu/tooltipto exposeuseInternalTooltipContext(since theset{Anchor,Trigger}Refare only available there. tbh would be nice if they were public too) and do something like this