Created for CSE 370
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.
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.
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!