Skip to content

Instantly share code, notes, and snippets.

@loklaan
Last active November 20, 2017 05:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loklaan/ddc03300d9990611a9b641e52fb36414 to your computer and use it in GitHub Desktop.
Save loklaan/ddc03300d9990611a9b641e52fb36414 to your computer and use it in GitHub Desktop.
Essentials to element-styles: the styles function.
import { styled } from 'element-styles'
@styled()
class Button extends Component {
render () {
const { styles, children, ...props } = this.props;
return (
<button {...props} {...styles('container')}>
<span {...styles('inner')}>{children}</span>
</button>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment