In the summer of 2016, the React team released a tool called
create-react-app. It creates a React app so that you can get started right
away. All of the code in this course runs with an app set up like this.
Getting started with React has never been easier.
- Make sure you have node.js
- Install the app generator
- Run the app generator
Server-side rendering might be easier with the fancy-pants version. More on that later.
Great, you have node and you're ready to go.
Run this command in a terminal:
$ npm install -g create-react-app
This installs a global npm package called
create-react-app. Its job is to
create a directory and install
Confusing, I know.
You can think of
react-scripts as two parts of the
same construction. The first is a lightweight script that you can install
globally and never update; the second is where the work happens. You want this
one to be fresh every time you start a new app.
Keeping a global dependency up to date would suck, especially considering there
have been six major updates since Facebook first launched
Superb! You have
create-react-app. Time to create an app and get started with
Run this in a terminal:
$ create-react-app reactdataviz-project
Your next step is to run your app:
$ cd reactdataviz-project$ npm start
A browser tab should open with a blank page and a spinning React logo.
If that didn't work, then something must have gone terribly wrong. You should consult the official docs. Maybe that will help.