Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mohsentaleb/822d2ea8fb36cdb621ac87321eed87e1 to your computer and use it in GitHub Desktop.
Save mohsentaleb/822d2ea8fb36cdb621ac87321eed87e1 to your computer and use it in GitHub Desktop.
import { MuiAvatar } from "@material-ui/core"
import { withStyles, Theme, createStyles } from '@material-ui/core/styles'
const Avatar = withStyles((theme: Theme) =>
createStyles({
colorDefault: {
// overriding `colorDefault` according to the Avatar API
backgroundColor: theme.palette.secondary
}
})
)(MuiAvatar) // Passing the original Avatar component to this HOC
function myComponent() {
return <Avatar />
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment