Using forwardRef under a Popover.Trigger #1940
-
Hi! I'm having trouble using a custom component with forwardRef under a Popover.Trigger. First time doing this with this lib so would appreciate if anybody can point me in the right direction! Here's the repo: https://github.com/samselikoff/2023-02-07-radix-popover-child-component And here's the Stackblitz: If you comment out my custom |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi @samselikoff, You should forward all props too const Button = forwardRef(function Button(
{ children, ...props }: { children: ReactNode },
ref
) {
return (
<button {...props} className="foo" ref={ref}>
{children}
</button>
);
}); |
Beta Was this translation helpful? Give feedback.
-
Makes sense. Thanks for all the info + awesome work on this lib! 🙏 |
Beta Was this translation helpful? Give feedback.
Hi @samselikoff,
You should forward all props too