Last active
February 23, 2018 14:55
-
-
Save dstarr/57d88c4b2e0b746e50117822b11729bc 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 from 'react'; | |
import PropTypes from 'prop-types'; | |
const ColorSwatch = (props) => { | |
let style = { | |
backgroundColor: props.color, | |
}; | |
return ( | |
<div style={style}> | |
<h2>{props.text}</h2> | |
<p> | |
Lorem ... | |
</p> | |
</div> | |
); | |
}; | |
ColorSwatch.PropTypes = { | |
color: PropTypes.string.isRequired, | |
text: PropTypes.string.isRequired | |
}; | |
export default ColorSwatch; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why not use
const style = { ... }
?