DEV Community

Poornima Gowda
Poornima Gowda

Posted on

2

Getting started with react

Firstly, React is a popular JavaScript library for building UI, especially for single-page applications. It allows developers to create reusable components and efficiently manage the state of their applications. In this blog, I'll go through the process of setting up a React project and many more.

Prerequisites
Before getting into the react or creating react project, you must have to install the following tools.

1. Node.js: you can download the latest version of Node.js from the official website: https://nodejs.org/en.
2. Code Editor: You can use any editor that you comfortable with, I highly recommended to use VSCode.

How to create a project

  1. Open command prompt or your terminal.
  2. Run the following cmd
//Replace my-app with the name of your project.
npx create-react-app my-app

//navigate to your project directory
cd my-app 

//this cmd helps us to run our script
npm start 
Enter fullscreen mode Exit fullscreen mode

Folder Structure

my-app/
├── node_modules/
├── public/
│   ├── index.html
│   └── manifest.json
├── src/
│   ├── components/
│   ├── App.css
│   ├── App.js
│   ├── App.test.js
│   ├── index.css
│   ├── index.js
│   └── reportWebVitals.js
├── .gitignore
├── package-lock.json
├── package.json
└── README.md
Enter fullscreen mode Exit fullscreen mode

1. node_modules: A directory where all the dependencies like libraries and packages required by your project are stored.

2. src: The source folder that contains all your React application code. This is where you write the components, styles, and logic for your React application.

3. package.json: A JSON file that contains metadata about your project and the dependencies it requires. It manages the project's dependencies, scripts, version, and other things.

Sentry mobile image

App store rankings love fast apps - mobile vitals can help you get there

Slow startup times, UI hangs, and frozen frames frustrate users—but they’re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your app’s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read full post →

Top comments (0)

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay