Book Image

Create React App 2 Quick Start Guide

By : Brandon Richey
Book Image

Create React App 2 Quick Start Guide

By: Brandon Richey

Overview of this book

If you're a power user and you aren’t happy always reusing default configurations, from previous applications with each new application, then all you need is Create React App (CRA), a tool in the React ecosystem designed to help you create boilerplate code for building a web frontend. This book will help you use CRA to write React programs without significant configuration-related difficulties. With this quick start guide, you will integrate your applications with React to build efficient professional web services.You will learn to design UIs with the features of CRA and template your React applications. By the end of the book, you will be sufficiently skilled to be able to build faster and effective React apps using CRA.
Table of Contents (10 chapters)

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...