Skip to content

Commit

Permalink
[mantine.dev] Fix incorrect documentation for custom Menu.Item compon…
Browse files Browse the repository at this point in the history
…ent (#7074)
  • Loading branch information
rtivital committed Nov 8, 2024
1 parent c566104 commit 2201441
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions apps/mantine.dev/src/pages/core/menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ function IncorrectItem() {
}

// ✅ Will work correctly with Menu.Item
function CorrectItem(
props: React.ComponentPropsWithoutRef<'button'>
) {
return (
<button type="button" {...props}>
My custom Menu item
</button>
);
}
const CorrectItem = forwardRef<
HTMLButtonElement,
React.ComponentPropsWithoutRef<'button'>
>((props, ref) => (
<button type="button" {...props} ref={ref}>
My custom Menu item
</button>
));

function Demo() {
// ❌ Will not work
Expand Down

0 comments on commit 2201441

Please sign in to comment.