Open
Conversation
Netlify deploy previewBundle size report
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the deprecated imgProps prop from the Avatar component as part of the v9 migration. The useLoaded hook is extracted into its own TypeScript file with improved type safety and conditional property setting.
Changes:
- Removed the deprecated
imgPropsprop fromAvatarcomponent, its types, PropTypes, and API docs - Extracted
useLoadedinto a separate TypeScript file (Avatar/utils/useLoaded.ts) with typed state and conditional property assignment - Updated docs and examples to use
slotProps.imginstead ofimgProps
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/mui-material/src/Avatar/utils/useLoaded.ts |
New file: extracted and improved useLoaded hook with TypeScript types |
packages/mui-material/src/Avatar/Avatar.js |
Removed imgProps prop, inline useLoaded, imported new hook |
packages/mui-material/src/Avatar/Avatar.d.ts |
Removed imgProps from type definitions |
packages/mui-material/src/Avatar/Avatar.test.js |
Removed one imgProps test (but missed another) |
packages/mui-material/src/Avatar/Avatar.spec.tsx |
Removed imgProps type spec test |
docs/src/modules/components/MaterialUIExampleCollection.js |
Migrated imgProps to slotProps.img |
docs/src/components/about/Team.tsx |
Migrated imgProps to slotProps.img |
docs/translations/api-docs/avatar/avatar.json |
Removed imgProps translation |
docs/pages/material-ui/api/avatar.json |
Removed imgProps from API page |
docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md |
Added migration guide for imgProps removal |
💡 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.
e37bbb1 to
2098dcd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.