Created
February 27, 2018 17:13
-
-
Save jugyo/6c30237d2172722957ed0b17603f032d to your computer and use it in GitHub Desktop.
React functional component with withStyles
This file contains 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
// <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