[avatargroup] Remove deprecated props#47968
Conversation
Netlify deploy previewBundle size report
|
There was a problem hiding this comment.
Pull request overview
Removes deprecated AvatarGroup customization APIs in preparation for v9, aligning the implementation, typings, tests, and generated API docs around the slots/slotProps (and surplus) slot API.
Changes:
- Removed the deprecated
componentsPropsprop and the legacyadditionalAvatarslot key fromAvatarGroup(JS + TS types + API docs). - Simplified slot prop forwarding to rely on
slotProps.surplus. - Updated migration docs to document the v9 removal/rename guidance.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/mui-material/src/AvatarGroup/AvatarGroup.js | Removes componentsProps and legacy slotProps mapping; updates PropTypes accordingly. |
| packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts | Removes deprecated componentsProps and additionalAvatar typing in favor of surplus. |
| packages/mui-material/src/AvatarGroup/AvatarGroup.test.js | Removes tests covering deprecated componentsProps.additionalAvatar behavior. |
| docs/pages/material-ui/api/avatar-group.json | Drops componentsProps and additionalAvatar from the published API JSON. |
| docs/translations/api-docs/avatar-group/avatar-group.json | Removes componentsProps description from translated API docs. |
| docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md | Adds v9 migration notes for AvatarGroup deprecated API removal. |
Comments suppressed due to low confidence (2)
packages/mui-material/src/AvatarGroup/AvatarGroup.js:66
componentsPropsis no longer destructured out ofprops, so if a consumer still passes it (e.g. via themedefaultPropsduring migration), it will end up in...otherand get spread onto the root DOM element. This can trigger React unknown-prop warnings and render an invalidcomponentsProps="[object Object]"attribute. Consider still destructuringcomponentsProps(e.g. into an unused local) so it’s filtered out and not forwarded to the DOM.
const {
children: childrenProp,
className,
component = 'div',
max = 5,
renderSurplus,
slotProps = {},
slots = {},
spacing = 'medium',
docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md:246
- The new AvatarGroup migration snippet opens a second fenced code block (```diff) but does not close it, which will break the Markdown rendering for the remainder of the page. Add the missing closing fence after the second example.
Also, since v9 removes support for the deprecated slotProps.additionalAvatar key (not just componentsProps.additionalAvatar), it would be clearer to explicitly mention slotProps.additionalAvatar → slotProps.surplus here (the deprecated-API migration guide already documents this rename).
The `componentsProps` prop has been removed. Use `slotProps` instead. The `additionalAvatar` key has been renamed to `surplus`:
```diff
-<AvatarGroup componentsProps={{ additionalAvatar: { className: 'my-class' } }}>
+<AvatarGroup slotProps={{ surplus: { className: 'my-class' } }}>
If you were already using the surplus key via componentsProps, move it to slotProps:
-<AvatarGroup componentsProps={{ surplus: { className: 'my-class' } }}>
+<AvatarGroup slotProps={{ surplus: { className: 'my-class' } }}>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
4b0e554 to
6c2b554
Compare
Uh oh!
There was an error while loading. Please reload this page.