A React “Hello, World!” Example

This github repository shows you how to set up a nice little development environment for React. First, copy the files to a working directory. Then run

npm i
npm start

The first command will initialize your project (something you only need to do the first time.) The second command will start a web server that will serve up your files locally.

Getting Started with React

It’s time I jump into the React development world with both feet. First question, of course, is “How do I set up a React development environment?”

I found the following steps:

  1. First, install node.js. I found out how to do that over here on this page. Visit the node.js site, download a .pkg file (I’m on a Mac) and run it.
  2. npm is included in node.js.  But we want to update it to the latest version.  Do so with the following command:  sudo npm install npm -g
  3. Install an node.js application that will create your React application project.  Use the following command to accomplish this:  sudo npm i create-react-app -g
  4. Now use a node.js app to create your application.  To do so, cd into the directory in which you want to create your project’s directory.  Then type:  create-react-app project-name