Skip to content
Related Articles
Open in App
Not now

Related Articles

Build a Basic React App that Display “Hello World!”

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 30 Sep, 2021
Improve Article
Save Article

React is a Javascript Library that was created by Facebook for building better User Interface(UI) web applications and mobile applications. It is an open source library for creating interactive and dynamic applications.

In this article, we will see how to build a basic react app that shows hello world.

  • To create a react application, Node.js version of at least 10 or higher need to be installed on your system. If it is installed you can check by using the following command in your command line.
node -v 

  • Make sure you have a code editor for working on your project files.

Let’s create our first react application:

To build a react application follow the below steps:

Step 1:  Create a react application using the following command 

npx create-react-app foldername

It takes a couple of minutes to install the packages.

Step 2:  Once it is done change your directory to the newly created application using the following command 

cd foldername

Project Structure: It is created as shown below.

Project file structure

Step 3: Now inside App.js and write down the following code as shown below:


import React from 'react';
import './App.css';
function App() {
      <h1> Hello World! </h1>
export default App;

Step to run the application: Enter the following command to run the application.

npm start

Output: You will see the following output in your browser.

Congratulations,  you have created your first react app. You have learnt something new today. Don’t stop learning Go ahead. Learn React.js

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!