Hi Coders, today we will discuss about a very simple demo in react js. So let’s proceed.
Step 1: Install node.js in your system
What is node.js ?
- Node.js is an open source, cross-platform runtime server environment for developing server-side and networking applications.
- Node.js applications are written in javascript.
Install it from its official site. Once nodejs is installed, npm is installed automatically. So now what is npm?
- Npm is stand for node package manger.
- Npm is a package manager for Node.js packages.
- A package in Node.js contains all the files you need for a module.
- Modules are JavaScript libraries you can include in your project.
Step 2: install react application in your system.
We will go with the easiest way. So let’s start by running the command in your terminal below:
npm install -g create-react-app
This command will install react-app globally in your system, after running this command successfully then you can create react project in your system and named the project name with your choice by running the command below:
create–react–app project–name
This command will take few’s moments to complete. And after completion the all of the processes then you can change the current directory to the react project directory by running the command below:
cd project
–name
After running this command now you are on the react app directory,then start react app in your local environment by running this command:
npm start
After running the npm start command your react app will run in the default browser of your system on http://localhost:3000
And your react app will look like this in your browser, see below:
Then finally this is your react app looked like this in your system.Then start coding in your src/App.js file.
That’s all for now. Thank you for reading and I hope this post will be helpful for beginners who are going to start working with reactjs.