Listing 10-5: CSS rule-sets vs. JavaScript style objects
/* CSS rule-set */
.headingStyle{
background-color: #999999;
color: #eee;
border: 1px solid black;
border-radius: 4px;
width: 50%;
}
//JavaScript style object
const headingStyle = {
backgroundColor: '#999999',
color: '#eee',
border: '1px solid black',
borderRadius: '4px',
width: '50%'
};
Download the examples, report issues, and ask/answer questions in the discussion area by visiting the book's github page. All of the code for the book is also available on codesandbox.io for you to play around with.
ReactJS Foundations is published by John Wiley and Sons, Inc and is available in paperback and eBook.