Skip to content

Using forwardRef under a Popover.Trigger #1940

Answered by joaom00
samselikoff asked this question in Help
Discussion options

You must be logged in to vote

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>
  );
});

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@benoitgrelard
Comment options

@samselikoff
Comment options

@benoitgrelard
Comment options

@samselikoff
Comment options

@benoitgrelard
Comment options

Answer selected by benoitgrelard
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants