React Starter Tutorial

Created for CSE 370

Getting Started

Part 1
Part 2
Part 3
Part 4
Part 5
Part 6
React Routing
Styling the navbar
Part 9
Part 10
Part 11
Part 12
Part 13
Part 14
Conclusion

Additional Resources

W3Schools React Tutorial
Official ReactJS Tutorial
ReactJS Documentation

Part 1

Getting Started

This tutorial has been adapted from w3schools.com’s React Tutorial to suit UB CSE’s 370 course (Human Computer Interaction).

You can access a full demo application for the course by visiting the Conclusion of this tutorial.

Technical Setup

We will be using Node.js and NPM (Node Package Manager) to setup and run our project. You can find installation instructions here.

Once we have NPM installed, we can use the create-react-app tool to get started! Open up a terminal and run the following command:

npx create-react-app my-social-media-site

You can replace my-social-media-site with whatever you would like to call your project. By running this command, a directory with a starter React application will be created.

Starting Our App

Now that we’ve created a new React app, we can start it using npm!

First, navigate to the new React application’s directory by running the following command:

cd my-social-media-site

Once inside the directory, we can start our React app by running

npm start

This will open up a new browser window with our webpage (hosted at localhost:3000 by default). Any time we make changes to our code while npm start is running, the webpage should update!

GO TO PART 2 ->