Skip to content

[DataGridPro] Avoid proptypes warnings with header filters in React 17 #17482

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

Merged

Conversation

cherniavskii
Copy link
Member

Fixes https://mui.zendesk.com/agent/tickets/26834

We use the useId() hook to generate IDs for these props.
But in React 17, useId() returns undefined as the initial value, which triggers the propTypes warning:
https://github.com/mui/material-ui/blob/e3d807e35a1b410dfb0d5240e72b8a8846768c03/packages/mui-utils/src/useId/useId.ts#L7-L20

Since we're going to remove propTypes anyway, I think it's OK to mark these specific props as optional.

@cherniavskii cherniavskii added scope: data grid Changes or issues related to the data grid product plan: Pro Impact at least one Pro user dx Related to developers' experience needs cherry-pick The PR should be auto-cherry-picked to a version branch after merge—add a version label as target v7.x feature: Filtering on header Related to the header filtering (Pro) feature labels Apr 21, 2025
Copy link

github-actions bot commented Apr 21, 2025

Thanks for adding a type label to the PR! 👍

@cherniavskii cherniavskii force-pushed the supress-proptypes-warnings-react-17 branch from 50f21cb to 07d4fc3 Compare April 21, 2025 22:22
@mui-bot
Copy link

mui-bot commented Apr 21, 2025

Deploy preview: https://deploy-preview-17482--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 2b1170d

@cherniavskii cherniavskii marked this pull request as ready for review April 21, 2025 22:48
@cherniavskii cherniavskii requested a review from a team April 22, 2025 09:58
@cherniavskii cherniavskii merged commit 124bfdd into mui:master Apr 22, 2025
21 checks passed
@cherniavskii cherniavskii deleted the supress-proptypes-warnings-react-17 branch April 22, 2025 12:19
Copy link

Cherry-pick PRs will be created targeting branches: v7.x

bernardobelchior pushed a commit to bernardobelchior/mui-x that referenced this pull request Apr 22, 2025
@oliviertassinari oliviertassinari added type: bug A bug or unintended behavior in the components. and removed maintenance labels Apr 30, 2025
@oliviertassinari oliviertassinari added core Covers general upkeep, such as minor refactoring, typo fixes, or structural changes. type: enhancement This is not a bug, nor a new feature labels May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Covers general upkeep, such as minor refactoring, typo fixes, or structural changes. dx Related to developers' experience feature: Filtering on header Related to the header filtering (Pro) feature needs cherry-pick The PR should be auto-cherry-picked to a version branch after merge—add a version label as target plan: Pro Impact at least one Pro user scope: data grid Changes or issues related to the data grid product type: bug A bug or unintended behavior in the components. type: enhancement This is not a bug, nor a new feature v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants