Skip to content

Instantly share code, notes, and snippets.

@janit
Last active December 20, 2015 09:59
Show Gist options
  • Save janit/a268ea1e86cb6bf5217d to your computer and use it in GitHub Desktop.
Save janit/a268ea1e86cb6bf5217d to your computer and use it in GitHub Desktop.
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