Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created February 27, 2018 17:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jugyo/6c30237d2172722957ed0b17603f032d to your computer and use it in GitHub Desktop.
Save jugyo/6c30237d2172722957ed0b17603f032d to your computer and use it in GitHub Desktop.
React functional component with withStyles
// <Foo onClick={this.handleClick} />
const Foo = withStyles((theme) => ({
foo: {
color: 'red',
},
}))((props) => {
const { classes, onClick } = props
return (
<div onClick={onClick} className={classes.foo}>
Foo
</div>
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment