#Menu and withProps

5 messages · Page 1 of 1 (latest)

plain umbra
#

Hi @strange marsh, would you consider adding withProps to Menu component? I just found that it doesn't have it even though the Menu.Item does.

strange marsh
#

Probably an error, I'll look into it

plain umbra
#

Hi @strange marsh, sorry for late response 😅, i just want to let you know, after testing out the Menu.withProps like:

import { Menu } from '@mantine/core';

export const ActionMenu = Menu.withProps({
  radius: 'md',
  closeOnItemClick: false,
  styles: {
    item: {
      borderRadius: 0,
      padding: 0,
    },
    divider: {
      margin: 0,
    },
  },
});

When used in component like:

<ActionMenu>
...
</ActionMenu>

I got ts error:

JSX element type 'ActionMenu' does not have any construct or call signatures.ts(2604)
'ActionMenu' cannot be used as a JSX component.
  Its type 'MenuProps' is not a valid JSX element type.ts(2786)

Thank you

strange marsh
plain umbra