Skip to content

Commit d060bd5

Browse files
Remove unnecessary renderTags prop from SizeSmallValueOverflow regression test and remove key warning
1 parent d98976c commit d060bd5

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

test/regressions/fixtures/Autocomplete/SizeSmallValueOverflow.js

+6-18
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,6 @@ export default function Sizes() {
8080
getOptionLabel={(option) => option.title}
8181
defaultValue={movies[0]}
8282
disableClearable
83-
renderTags={(value, getTagProps) =>
84-
value.map((option, index) => (
85-
<Chip
86-
variant="outlined"
87-
label={option.title}
88-
size="small"
89-
{...getTagProps({ index })}
90-
/>
91-
))
92-
}
9383
renderInput={(params) => (
9484
<TextField {...params} variant="filled" label="Movies" placeholder="Favorites" />
9585
)}
@@ -103,14 +93,12 @@ export default function Sizes() {
10393
defaultValue={[movies[0]]}
10494
disableClearable
10595
renderTags={(value, getTagProps) =>
106-
value.map((option, index) => (
107-
<Chip
108-
variant="outlined"
109-
label={option.title}
110-
size="small"
111-
{...getTagProps({ index })}
112-
/>
113-
))
96+
value.map((option, index) => {
97+
const { key, ...other } = getTagProps({ index });
98+
return (
99+
<Chip key={key} variant="outlined" label={option.title} size="small" {...other} />
100+
);
101+
})
114102
}
115103
renderInput={(params) => (
116104
<TextField {...params} variant="filled" label="Movies" placeholder="Favorites" />

0 commit comments

Comments
 (0)