![Beginning with react js](https://images.ctfassets.net/vzl5fkwyme3u/1f9o6QZdnHnyL7FL4jYAt6/49052d4de22e08100a0d4f7bae4347d3/reactjs.png?w=1000)
### Table of contents
2. Feature of SPA
3. Why React
5. Make a basic react project
### 1. Introduction
### 2. Feature of SPA
SPA (Single Page Application) is fast, compare to other application.
Instead of updating whole page, it's only update the changes in the view.
Although it load all the content once and serve according to the requriment.
It will improve the site preformance because it will not reload page again and again.
### 3. Why React
**Q. When to use react ?**
b. Uni-directional data flow - React focus on only view part. It provides uni-directional data flow. Means you can pass data from parent to child in HTML props. Due to this feature our application is more managable, because all the data is manage by parent. Props flow from parent to child and functions flow from child to parent.
### 4. Prerequisites
### 5. Make a basic react project
Install Node -- I personally prefer node version manager(nvm) to install node. Because it gives you flexablity to use multiple version of node and npm
In order to install nvm, you have to install curl. Here is the command
sudo apt-get update
sudo apt-get install curl
you will get the message
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL
Now install nvm with curl. Here is the command
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh
inspect installation with nano
Run script with bash
Now load your profile to current bash
nvm is installed Now, check it with
now check list of node installed by
install new node with
nvm install 10.15.3 (node_version)
use particular node
nvm use 8.10.0 (node_version)
You will successfully install required things for node.
#### Now lets create a react project.
First install create-react-app globally so that you can use it from anywhere. create-react-app is npm module given by react to setup a basic arcitecture of react project.
npm install -g create-react-app
After installation of create-react-app
This command will create a directory name w3school_info in your current directory. Which have all the basics setup which react app have.
Now you can open your browser on `http://localhost:3000`will run you React project.
#### This is your basic app structure.
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
Go and change something in `App.js` and changes will automatically updated on your browser.
You are ready to start development!
***Please feel free to write your queries on comment section***