Today, we're going to be following a great tutorial from the React docs! But let's take care of some things first.
Before we start our workshop today, we need to install Node.js.
You might be thinking, "wait, what is node.js?" Well before we get into that, let's talk about JavaScript. JavaScript, like Python, is an interpreted language. This means an interpreter reads each line, interprets it, and runs it just-in-time and traditionally, this only happened in the browser context.
Node.js allows you to run JavaScript outside of the browser by providing an asynchronous, event-driven JavaScript runtime. This opens up the possibility of using JavaScript to write servers or command line tools.
You can install Node.js using their installer if you're running Mac Os. Alternatively, you can use brew (brew install node).
Once Node.js is installed, you can execute JavaScript programs locally using the node command. Node also comes with a package manager, which you can use with the npm command.
- Clone this repo:
git clone <this repo's remote url> - Change directories:
cd wit_react_starter - Install the project dependencies:
npm install
Great! Now you can start the local development server by running npm start. The React app is hosted on localhost:3000. Any changes to your code will cause the server to hot reload.
Now you're ready to get started! You can find the tutorial here. Make sure to read all of the sections as they are very informative. However, you can skip the "Setup for the Tutorial" section, since we've set up this start code for you.