ReactJs Tutorials
How to install ReactJs.
For ReactJS
NodeJs must be installed.
Node Version
C:\>node -v
How to install ReactJS?
There are two ways to install ReactJs.
Using the npm command
Install NodeJS and NPM :-
File name : index.php
Using the create-react-app command
You can install React using npm package manager by using the below command.
File name : index.php
Install React :
C:\>mkdir ittutorial
C:\>cd ittutorial
C:\ittutorial>npm install -g create-react-app
Create a new React project :-
create a new react project using create-react-app command.
C:\ittutorial> create-react-app myproject
NOTE :-
NOTE: You can combine the above two steps in a single command using npx. The npx is a package runner tool that comes with npm 5.2 and above version.
C:\ittutorial> npx create-react-app myproject
The above command will install the react and create a new project with the name myproject.
create-react-app will set up everything you need to run a React application.
Running the Server
After completing the installation process, you can start the server by running the following command.
C:\ittutorial>cd myproject
C:\ittutorial\myproject>npm start
It will show the port number which we need to open in the browser. After we open it. If not, open your browser and type localhost:3000 in the address bar.
localhost:3000
File name : index.php
npx create-react-app myblog
Envoronment Setup :-
File name : index.php
C:\react\myblog>npm start
Open Visual Studio
open your react mybolog folder
Create Components
open src folder in your myblog folder
src
create Components folder
under components folder create Common folder
under common folder create header.js page
under common folder create leftsidebar.js page
under common folder create footer.js page
Create HTML Pages
open Public folder in your myblog folder
src
create index.html page
How does React Work?
React creates a VIRTUAL DOM in memory.
version
Current version of React.JS is V17.0.2 (August 2021).
Initial Release to the Public (V0.3.0) was in July 2013.
React.JS was first used in 2011 for Facebook's Newsfeed feature.