Skip to content

Instantly share code, notes, and snippets.

@rickycodes
Last active September 29, 2016 16:19
Show Gist options
  • Save rickycodes/d3c814cd0e3e41f7d45a926f3e11fae2 to your computer and use it in GitHub Desktop.
Save rickycodes/d3c814cd0e3e41f7d45a926f3e11fae2 to your computer and use it in GitHub Desktop.
react/jsx style props example using Object.assign
import style from './style'
// example usage of Object.assign (needs to be shimmed) to mix things together
export default React.createClass({
render() {
return (
<aside style={Object.assign({color:'red'}, style.aside)} />
)
}
})
import style from './style'
// example usage of "style" module for style props
export default React.createClass({
render() {
return (
<aside style={style.aside} />
)
}
})
module.exports = {
aside: {
background: 'black',
textDecoration: 'none',
width: 200
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment