Styles in JSX
"Mike, all of the things that we did today are very cool. When do we start adding styles? How can I make this page look pretty? Right now it's a bit dull." Shawn asked.
"Ah, right. Let's do that. React allows us to pass styles to the components the same way props can be passed. For example, we want our headings to be of the floral white color and maybe we want to change the font size. We will represent it in a typical CSS way as follows:"
background-color: 'FloralWhite', font-size: '19px';
"We can represent this as a JavaScript object in the CamelCase fashion."
var headingStyle = { backgroundColor: 'FloralWhite', fontSize: '19px' };
Then, we can use it in each Heading component as a JavaScript object."
RecentChangesTable.Heading = React.createClass({ render: function() { var headingStyle = { backgroundColor: 'FloralWhite', fontSize: '19px' }; return(<th style={headingStyle}>{this.props.heading...