Reader small image

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

Product typeBook
Published inFeb 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789952766
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Brandon Richey
Brandon Richey
author image
Brandon Richey

Brandon Richey is a software engineer and a React enthusiast who has written several popular React tutorials. He has been making professional and hobby programming projects spanning healthcare, personal sites, recruiting, and game development for nearly 20 years! Brandon is the author of the Packt book 'Create React App 2 Quick Start Guide'.
Read more about Brandon Richey

Right arrow

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 page is locked
Previous PageNext Page
You have been reading a chapter from
Create React App 2 Quick Start Guide
Published in: Feb 2019Publisher: PacktISBN-13: 9781789952766

Author (1)

author image
Brandon Richey

Brandon Richey is a software engineer and a React enthusiast who has written several popular React tutorials. He has been making professional and hobby programming projects spanning healthcare, personal sites, recruiting, and game development for nearly 20 years! Brandon is the author of the Packt book 'Create React App 2 Quick Start Guide'.
Read more about Brandon Richey