Skip to content

[avatargroup] Remove deprecated props#47968

Open
silviuaavram wants to merge 2 commits intomui:masterfrom
silviuaavram:chore/remove-deprecated-props-3
Open

[avatargroup] Remove deprecated props#47968
silviuaavram wants to merge 2 commits intomui:masterfrom
silviuaavram:chore/remove-deprecated-props-3

Conversation

@silviuaavram
Copy link
Member

@silviuaavram silviuaavram commented Mar 13, 2026

@silviuaavram silviuaavram added breaking change Introduces changes that are not backward compatible. scope: avatar Changes related to the avatar. labels Mar 13, 2026
Copilot AI review requested due to automatic review settings March 13, 2026 14:20
@silviuaavram silviuaavram added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. v9.x labels Mar 13, 2026
@mui-bot
Copy link

mui-bot commented Mar 13, 2026

Netlify deploy preview

Bundle size report

Bundle Parsed size Gzip size
@mui/material ▼-76B(-0.01%) ▼-8B(-0.01%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 382eadb

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 componentsProps prop and the legacy additionalAvatar slot key from AvatarGroup (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

  • componentsProps is no longer destructured out of props, so if a consumer still passes it (e.g. via theme defaultProps during migration), it will end up in ...other and get spread onto the root DOM element. This can trigger React unknown-prop warnings and render an invalid componentsProps="[object Object]" attribute. Consider still destructuring componentsProps (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.additionalAvatarslotProps.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.

@silviuaavram silviuaavram force-pushed the chore/remove-deprecated-props-3 branch from 4b0e554 to 6c2b554 Compare March 13, 2026 14:43
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. scope: avatar Changes related to the avatar. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. v9.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants