Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has GridActionsCellItem error with props?

I'm having issue when passing props in the

GridActionsCellItem

in

'@mui/x-data-grid';

colums;

   {
      field: 'actions',
      type: 'actions',
      width: 80,
      getActions: (params: any) => [
        <GridActionsCellItem
        icon={<DeleteIcon />}
        label="Delete"
        onClick={test(params.id)}
        showInMenu
      />,
      <GridActionsCellItem
      icon={<DeleteIcon />}
      label="Delete"
      onClick={test(params.id)}
      showInMenu
    />,
      ],
    },

Error that im having

Type '{ icon: Element; label: string; onClick: () => void; showInMenu: true; }' is missing the following properties from type 'Pick<{ label: string; icon?: ReactElement<any, string | JSXElementConstructor> | undefined; } & { showInMenu: true; } & { autoFocus?: boolean | undefined; ... 6 more ...; sx?: SxProps<...> | undefined; } & Omit<...> & CommonProps & Omit<...>, "label" | ... 276 more ... | "divider">': nonce, onResize, onResizeCapture

i want to have empty colum with 3 dots that open a dropdown with some options.

like image 878
deni Avatar asked Sep 14 '26 14:09

deni


1 Answers

The <GridActionsCellItem on @mui/x-data-grid version "5.17.12" has some problems. So switch to @mui/x-data-grid version 5.17.8. Everything works fine.

like image 60
deni Avatar answered Sep 17 '26 05:09

deni