-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Warning: A props object containing a "key" prop is being spread into JSX #14299
Comments
Thanks for raising this @S-e-b-a-s ... I can confirm this bug and have found the cause of it. here is a diff with a potential fix: diff --git a/packages/x-data-grid/src/components/panel/filterPanel/GridFilterInputMultipleValue.tsx b/packages/x-data-grid/src/components/panel/filterPanel/GridFilterInputMultipleValue.tsx
index e62a47501..6482be992 100644
--- a/packages/x-data-grid/src/components/panel/filterPanel/GridFilterInputMultipleValue.tsx
+++ b/packages/x-data-grid/src/components/panel/filterPanel/GridFilterInputMultipleValue.tsx
@@ -65,14 +65,18 @@ function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps)
value={filterValueState}
onChange={handleChange}
renderTags={(value, getTagProps) =>
- value.map((option, index) => (
- <rootProps.slots.baseChip
- variant="outlined"
- size="small"
- label={option}
- {...getTagProps({ index })}
- />
- ))
+ value.map((option, index) => {
+ const { key, ...tagProps } = getTagProps({ index });
+ return (
+ <rootProps.slots.baseChip
+ variant="outlined"
+ size="small"
+ label={option}
+ key={key}
+ {...tagProps}
+ />
+ );
+ })
}
renderInput={(params) => (
<rootProps.slots.baseTextField |
@michelengelen pr opened #14302 |
@S-e-b-a-s: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Steps to reproduce
Link to live example: StackBlitz Example
Steps:
Complete traceback:
Possible issue related with MUI Core mui/material-ui#39833
Context
I'm in the process of migrating all my DataGrid components to the latest major version. During testing, I encountered this warning.
Your environment
npx @mui/envinfo
Search keywords: datagrid, chip, filter,
The text was updated successfully, but these errors were encountered: