“Hello World” in React

Vinay Mandge
CodeX
Published in
2 min readApr 9, 2022
Photo by Ferenc Almasi on Unsplash

What is React?

React is a free and open-source front-end JavaScript library for building user interfaces based on UI components. It is used to create a single-page web application which allows us to create reusable components.

Prerequisites for react

As we start, we need a code editor for instance I am using VS Code and also I’ll recommend it to others as well due to its easy-to-use features and large number of extensions.

To initiate a react app we need to run the following command on terminal/CMD.

npx create-react-app app-name

After running the above command some files and folders will be created under the directory which will look like

File structure for react project

Open App.js where you will find the main code to render the index.html

App.js

So, it’s time to run our react app for that we will use following command

which will open a tab on the web browser.

npm start

After running this command you will see the following output in the web browser

we can also change the content inside app.js file like printing hello world in browser

output will be

hello world ouput

So, this was all about “Hello World” in React.

Thank you!

--

--