Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Create React App 2 Quick Start Guide

You're reading from  Create React App 2 Quick Start Guide

Product type Book
Published in Feb 2019
Publisher Packt
ISBN-13 9781789952766
Pages 188 pages
Edition 1st Edition
Languages
Author (1):
Brandon Richey Brandon Richey
Profile icon Brandon Richey

What tools are available?

Create React App, by default, supports us getting CSS into our application in a number of different ways.

We can get CSS directly into our components by writing a style attribute and giving it some arbitrary CSS, as in the following code:

const Example = () => {
return (
<div className="Example" style="border: 1px solid red;">
Hello
</div>
);
};

This will give us a little div with the word Hello in it, surrounded by a single-pixel red line for the border. While this is something you technically can do, generally speaking, you should avoid it. Using inline style statements like the preceding example makes it hard to keep your styles organized and track them down when formatting does go awry. Plus, if a designer or another non-developer needs to update the look and feel (for example, if the standard colors...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}