Skip to content

Commit

Permalink
Revert "[Avatar] Allow to set src and children (mui#17694)"
Browse files Browse the repository at this point in the history
This reverts commit 67f6bda.
  • Loading branch information
mbrookes committed Oct 24, 2019
1 parent cec2f0c commit 01bf5f4
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions packages/material-ui/src/Avatar/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,22 @@ const Avatar = React.forwardRef(function Avatar(props, ref) {
...other
} = props;

let children = childrenProp;
let children = null;
const img = src || srcSet;

if (img) {
children = (
<React.Fragment>
<img
alt={alt}
src={src}
srcSet={srcSet}
sizes={sizes}
className={classes.img}
{...imgProps}
/>
{children}
</React.Fragment>
<img
alt={alt}
src={src}
srcSet={srcSet}
sizes={sizes}
className={classes.img}
{...imgProps}
/>
);
} else {
children = childrenProp;
}

return (
Expand Down

0 comments on commit 01bf5f4

Please sign in to comment.