liveBook · Manning

Create React App

As explained in React Quickly, Second Edition

create-react-app is a command-line utility that scaffolds a new React application with its project structure and dependencies.

Create React App (CRA) is a command-line utility for starting a React application without assembling its build setup yourself. With a modern Node and npm installation, run `npx create-react-app name-of-app`. The command creates a folder, initializes Git, and installs the project’s dependencies. section 2.1

Run the starter app

After creation, run `cd name-of-app` and `npm start`. The development server serves the default app in your browser at `localhost:3000`. Edit the source files to see the app recompile and update. section 2.1

CRA supplies JSX transpiling, bundling, testing, and automatic reloading. That convenience means you do not have to configure a JSX transpiler before building components, but it also hides some of the setup and limits control over the tools selected for you. section 2.1.4 section 3.3

Start from a template

To create an app with a specified template, run `npx create-react-app rq02-nesting --template rq02-nesting`. A template provides a ready-made starting point rather than an empty setup. section 2.2

Use `npm run build` to bundle the app for production or `npm test` to start the test runner. `npm run eject` copies the build configuration into the app directory, but the change cannot be reversed. section 2.1

How React Quickly, Second Edition covers it

How deep it goes
Walks through creation and startup commands and weighs setup trade-offs, but defers configuring a JSX transpiler from scratch.
Examples
Uses a named starter app and a `rq02-nesting` template command as runnable examples.
What it assumes
Assumes modern Node and npm, but does not require prior experience configuring a JSX transpiler.
What you can do after
Apply it via `npx` to create and run a React app, optionally starting from a specified template.
How it connects
Connects React project scaffolding to JSX transpilation, bundling, testing, templates, and development servers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of React Quickly, Second Edition. The section links point to the parts of the book it draws on.