React
Web Development
JavaScript
Programming
Frontend Development
Coding Tutorial
App Development

How to Create a React App: A Step-by-Step Guide

Deepak Tewatia
September 5, 2025
3 min read

How to Create a React App: A Step-by-Step Guide

Creating a React app is easy! In this guide, we will show you how to set up your own project step by step. You will learn how to install the tools you need, make your first component, and see your app in action. Let’s get started on building something great together!

What is React?

React is a JavaScript library that helps you build user interfaces. It allows you to create simple and reusable UI components. This means you can make your app faster and easier to manage. React is popular among developers for its speed and efficiency.

What You Need

Before we begin, make sure you have the following tools installed on your computer:

  • Node.js: This is what runs JavaScript on your computer, outside of a web browser.
  • npm: This package manager comes with Node.js. It helps you install libraries and tools for your project.
  • A code editor: You can use any text editor, but popular ones include Visual Studio Code, Sublime Text, or Atom.

Installing React

Follow these steps to create your first React app:

  1. Open your terminal or command prompt.
  2. Run the following command to install Create React App, a tool that sets everything up for you:
  3. npx create-react-app my-app
  4. This command creates a new folder called my-app with all the files you need.
  5. Once that’s done, navigate into your new app’s directory:
  6. cd my-app
  7. Now to start your app, type:
  8. npm start
  9. Your default web browser will open, showing your new React app!

Your First Component

Components are the heart of any React app. Let’s create a simple component to display a welcome message.

  1. In your code editor, find the folder called src. Inside, you will see a file called App.js. Open this file.
  2. Replace the default code with the following:
  3. import React from 'react';
    
    function App() {
        return (
            

    Welcome to My React App!

    This is my first component.

    ); } export default App;
  4. Save the changes and head back to your browser. You should see your welcome message!

Adding More Components

Let's add another component to show how to keep your code organized. Create a new file named Greeting.js in the src folder.

  1. Add the following code to Greeting.js:
  2. import React from 'react';
    
    function Greeting() {
        return 

    Hello, friend!

    ; } export default Greeting;
  3. Now, go back to App.js and import the new Greeting component:
  4. import Greeting from './Greeting';
  5. Next, use the Greeting component inside the App function:
  6. function App() {
        return (
            

    Welcome to My React App!

    This is my first component.

    ); }
  7. Save your changes again. Now you should also see "Hello, friend!" under your welcome message.

Next Steps

Now that you have a basic React app running, you can start adding more features. Here are some ideas to consider:

  • Learn about React's state and props to make your components more interactive.
  • Explore routing to create multiple pages in your app using React Router.
  • Look into styling your app with CSS or use libraries like Styled Components.

Conclusion

Creating a React app is straightforward. You installed the necessary tools, created your first component, and even added another one. With practice, you can build amazing web applications. Keep exploring and building your skills. Happy coding!

Comments

Y
You
Commenting
0/2000
Loading comments…