React.js tutorial, step-by-step guide to create a React app.

In my last post, I informed you about what is React, why is it used, what are its benefits over using HTML, CSS and JavaScript, and what are its drawbacks. We discussed these topics in detail. Now, in this post I will guide you to make your first React app.







Step-by-Step guide for create a React app.

1. Pre-requisites 

  • A Code Editor - In this post, we will use Microsoft Visual Studio Code.
  • Node.js - Download and install node by visiting https://nodejs.org/ and follow all the instructions mentioned in order to install it. After installation you can verify the installation by running node -v in your terminal/command prompt.

2. Create a New React Project


Create a new directory for your React project and open Visual Studio Code in the directory.

  • Use the command npx create-react-app my-react-app to initialize your React project and create the app my-react-app. Your folder structure should look like this: 
    



  • After the installation, run the command cd my-react-app in the terminal.
  • Now, start the development server by using the command npm start.
  • The server should be running at http://localhost:3000.




Congratulations! Your first React app is created!

Comments

Popular posts from this blog

Different types of hooks in React and their uses.

Building a weather app using React.js