Last active
December 20, 2015 09:59
-
-
Save janit/a268ea1e86cb6bf5217d to your computer and use it in GitHub Desktop.
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
import React, { Component } from 'react' | |
import useSheet from 'react-jss' | |
// You can use jss directly too! | |
import jss from 'jss' | |
import vendorPrefixer from 'jss-vendor-prefixer' | |
jss.use(vendorPrefixer) | |
const styles = { | |
button: { | |
'background-color': 'yellow' | |
}, | |
label: { | |
'font-weight': 'bold' | |
} | |
} | |
class Button extends Component { | |
onClick: function(e) { | |
alert('hello!'); | |
}, | |
render() { | |
const { classes } = this.props.sheet | |
return ( | |
<div className={classes.button}> | |
<span className={classes.label} onClick={this.sayHello}> | |
{this.props.children} | |
</span> | |
</div> | |
) | |
} | |
} | |
export default useSheet(Button, styles) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment