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] GridActionsCellItem rejects component props with TypeScript #16510

Open
MorrisonCole opened this issue Feb 9, 2025 · 1 comment
Assignees
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@MorrisonCole
Copy link

MorrisonCole commented Feb 9, 2025

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/~/github.com/MorrisonCole/repro-mui-x-GridActionsCellItem-types
  2. Take a look at requiredComponentPropsShouldNotError. Here we pass an unknown prop to GridActionsCellItem but no TS error is thrown 🐛
  3. Take a look at missingRequiredComponentPropsShouldError - here we pass a custom component with the component prop, but its required props are not marked as a TS error 🐛

I've included similar examples with ButtonBase, which work as expected and demonstrate what I believe to be the correct behaviour - see missingRequiredComponentPropsShouldErrorButtonBase & requiredComponentPropsShouldNotErrorButtonBase.

Current behavior

GridActionsCellItem rejects its component props in TypeScript.

Expected behavior

GridActionsCellItem accepts component props for the component passed.

Context

In the MUI docs it is stated that:

Not every component fully supports any component type you pass in. If you encounter a component that rejects its component props in TypeScript, please open an issue. There is an ongoing effort to fix this by making component props generic.

I assume this is one of those cases!

Your environment

npx @mui/envinfo
  System:
    OS: macOS 15.3
  Binaries:
    Node: 22.13.1 - ~/.nvm/versions/node/v22.13.1/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.13.1/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 133.0.6943.54 <-- used this
    Edge: Not Found
    Safari: 18.3
  npmPackages:
    @emotion/react:  11.13.3
    @emotion/styled:  11.13.0
    @mui/base:  5.0.0-dev.20240529-082515-213b5e33ab
    @mui/core-downloads-tracker:  5.16.4
    @mui/icons-material:  6.4.2
    @mui/lab:  6.0.0-beta.25
    @mui/material:  6.4.2
    @mui/private-theming:  5.16.5
    @mui/styled-engine:  5.16.4
    @mui/system:  6.4.2
    @mui/types:  7.2.21
    @mui/utils:  6.4.2
    @mui/x-data-grid:  7.25.0
    @mui/x-data-grid-generator:  7.25.0
    @mui/x-data-grid-pro:  7.25.0
    @mui/x-date-pickers:  7.25.0
    @mui/x-date-pickers-pro:  7.25.0
    @mui/x-internals:  7.25.0
    @mui/x-license:  7.25.0
    @mui/x-tree-view:  7.25.0
    @types/react:  18.3.1
    react:  18.3.1
    react-dom:  18.3.1
    typescript: 5.7.2 => 5.7.2

Search keywords: GridActionsCellItem, OverrideProps, Property does not exist on type

Order ID: 102053

@MorrisonCole MorrisonCole added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 9, 2025
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Feb 9, 2025
@michelengelen
Copy link
Member

Hi @MorrisonCole ... thanks for opening this issue. I can confirm that this is a bug we need to fix, so I'll add this to the board. I know that @romgrk is currently working on the base components, so maybe he can adjust this while working on the others as well.

@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 10, 2025
@michelengelen michelengelen changed the title GridActionsCellItem rejects component props with TypeScript [data grid] GridActionsCellItem rejects component props with TypeScript Feb 10, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Feb 10, 2025
@romgrk romgrk self-assigned this Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
Status: 🆕 Needs refinement
Development

No branches or pull requests

3 participants