React
How
does React works
React creates a VIRTUAL DOM in memory.
Instead
of manipulating the browser's DOM directly, React creates a virtual DOM in
memory, where it does all the necessary manipulating, before making the changes
in the browser DOM.
React only changes what needs to be changed!
React
finds out what changes have been made, and changes only what needs to be changed.
To use React in production, you need NPM and
Node.js
To get an overview of what React is, you can
write React code directly in HTML. But in order to use React in production, you
need NPM and Node.js installed.
React.js
History
·
Current version of React.JS is V16.8.6 (March 2019).
·
Initial Release to the Public (V0.3.0) was in July 2013.
·
React.JS was first used in 2011 for Facebook's Newsfeed feature.
·
Facebook Software Engineer, Jordan Walke, created it.
·
The create-react-app version 2.0 package was released in October
2018.
·
Create-react-app version 2.0 supports Babel 7, webpack 4, and
Jest23.
Setting up a React Environment
If
you have NPM and Node.js installed, you can create a React application by first
installing the create-react-app.
Install
create-react-app by running this command in your terminal:
C:\Users\Your Name>npm install
-g create-react-app
Then you are able to create a React
application, let's create one called myfirstreact
.
Run this command to create a React application named myfirstreact
:
C:\Users\Your Name>npx
create-react-app myfirstreact
The create-react-app will set up everything you need to run a React application.
Run the React
Application
Now you
are ready to run your first real React application!
Run this
command to move to the myfirstreact directory:
C:\Users\Your Name>cd
myfirstreact
Run this
command to run the React application myfirstreact:
C:\Users\Your Name\myfirstreact>npm
start
A new
browser window will pop up with your newly created React App! If not, open your
browser and type localhost:3000 in the
address bar.
Comments
Post a Comment