[data grid] GridActionCellItem compiler error, missing properties #12040
Labels
component: data grid
This is the name of the generic UI component, not the React module!
status: waiting for author
Issue with insufficient information
support: docs-feedback
Feedback from documentation page
Related page
https://mui.com/x/react-data-grid/editing/
Kind of issue
Missing information
Issue description
From the demo https://mui.com/x/react-data-grid/editing/#full-featured-crud I followed the same GridActionCellItem format. However using typescript, when I tried what was in the demo it threw the following error saying it was missing properties.
Type '{ key: string; icon: Element; label: string; sx: { color: "primary.main"; }; }' is not assignable to type 'IntrinsicAttributes & ((Pick<{ label: string; icon?: ReactElement<any, string | JSXElementConstructor<any>> | undefined; } & ... 4 more ... & Omit<...>, "id" | ... 283 more ... | "showInMenu"> | Pick<...>) & RefAttributes<...>)'. Type '{ key: string; icon: Element; label: string; sx: { color: "primary.main"; }; }' is missing the following properties from type 'Pick<{ label: string; icon?: ReactElement<any, string | JSXElementConstructor<any>> | undefined; } & { showInMenu: true; } & { autoFocus?: boolean | undefined; ... 6 more ...; sx?: SxProps<...> | undefined; } & Omit<...> & CommonProps & Omit<...>, "id" | ... 276 more ... | "showInMenu">': onResize, onResizeCapture, showInMenuts(2322)
Using Github CoPilot, it suggested to add the following props to the GridActionCellItem
key, onResize, onResizeCapture, showInMenu
After adding these props they resolved the issue. These need to be added to the demo because the docs are incorrect
Context
No response
Search keywords: datagrid actions column cell missing properties
The text was updated successfully, but these errors were encountered: