Build a Basic React App that Display “Hello World!”
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.
- 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
Project Structure: It is created as shown below.
Step 3: Now inside App.js and write down the following code as shown below:
Step to run the application: Enter the following command to run the application.
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