Skip to content
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

[Avatar] Fix TypeScript error on imgProps #30255

Merged
merged 5 commits into from
Dec 28, 2021
Merged

Conversation

ahmad-reza619
Copy link
Contributor

@mui-pr-bot
Copy link

mui-pr-bot commented Dec 18, 2021

No bundle size changes

Generated by 🚫 dangerJS against f0b56fe

@siriwatknp siriwatknp changed the title fix ts error on imgProps.sx [Avatar] fix TS error on imgProps.sx Dec 20, 2021
@siriwatknp siriwatknp added the PR: needs test The pull request can't be merged label Dec 20, 2021
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Looks good, let's add test to verify we won't break it again in the future. You can add a file in the same folder as the component, named Avatar.spec.tsx, with this code:

import * as React from 'react';
import Avatar from '@mui/material/Avatar';

function ImgPropsShouldSupportSx() {
  <Avatar imgProps={{ sx: { objectFit: "contain" }}} />;
}

@ahmad-reza619
Copy link
Contributor Author

uhh sorry, i was using github.dev, i will work on this once i'm at home

@ahmad-reza619
Copy link
Contributor Author

So, I've tried running yarn prettier as suggested in the CI but nothing changed, so I confused about what to do at this point

@mnajdova
Copy link
Member

So, I've tried running yarn prettier as suggested in the CI but nothing changed, so I confused about what to do at this point

Not sure why you didn't see any changes. I've run and committed them. Should be good to go now. Thanks!

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

👌

@mnajdova mnajdova merged commit 98c9aad into mui:master Dec 28, 2021
@mnajdova mnajdova changed the title [Avatar] fix TS error on imgProps.sx [Avatar] Fix TypeScript error on imgProps Dec 28, 2021
@ahmad-reza619
Copy link
Contributor Author

Ok thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: needs test The pull request can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong propType for <Avatar imgProps={} />
4 participants