Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data grid] GridActionCellItem compiler error, missing properties #12040

Closed
drewg2009 opened this issue Feb 12, 2024 · 2 comments
Closed

[data grid] GridActionCellItem compiler error, missing properties #12040

drewg2009 opened this issue Feb 12, 2024 · 2 comments
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

Comments

@drewg2009
Copy link

drewg2009 commented Feb 12, 2024

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

@drewg2009 drewg2009 added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Feb 12, 2024
@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Feb 13, 2024
@michelengelen
Copy link
Member

Hey @drewg2009 I cannot reproduce the error with the information you gave here.

Please provide a minimal reproduction test case with the latest version. This would help a lot 👷.

A live example would be perfect. You can find a examples and guides on how to find templates in our docs with which you can provide examples for your specific use-case: Support - Bug reproduction.

Thank you! 🙇🏼

@michelengelen michelengelen added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 15, 2024
@michelengelen michelengelen changed the title GridActionCellItem compiler error, missing properties [data grid] GridActionCellItem compiler error, missing properties Feb 15, 2024
Copy link

The issue has been inactive for 7 days and has been automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants