-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
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
}Jack-the-Pro101
Metadata
Metadata
Assignees
Labels
No labels