Skip to content

Commit

Permalink
Forward ref in the MenuIconButton component
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak committed Oct 6, 2023
1 parent e0ff477 commit e067d9d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/pages/experiments/base/render-props.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ function WithSlotsAndSlotProps() {
);
}

function MenuIconButton(props: MenuButtonRootSlotProps) {
const MenuIconButton = React.forwardRef(function MenuIconButton(
props: MenuButtonRootSlotProps,
ref: React.ForwardedRef<HTMLButtonElement>,
) {
return (
<IconButton data-testid="hamburger-menu" {...props}>
<IconButton data-testid="hamburger-menu" {...props} ref={ref}>
{props.children}
</IconButton>
);
}
});

function WithSlots() {
return (
Expand Down

0 comments on commit e067d9d

Please sign in to comment.