- Using node packet executer
cmd > npx create-react-app [app-name]
- Using vite module : light weight
cmd> npm create vite@latest
cmd> [project Name]
- file name first letter to be UpperCase
- Use .jsx extension When retun any HTML otherwise .js can be used.
const UserName = Rajeev;
Example : <h1>Learning react with {UserName}</h1>
UI updation ko react control krta hai.
import hooks from react
import { useState } from 'react';
const [counter, setCounter] = useState(10);
// 2 things return in form of array 0->variable, 1->Method
In traditional websites, the browser requests a document from a web server, downloads and evaluates CSS and JavaScript assets, and renders the HTML sent from the server. When the user clicks a link, it starts the process all over again for a new page.
Client side routing allows your app to update the URL from a link click without making another request for another document from the server. Instead, your app can immediately render some new UI and make data requests with 'fetch' to update the page with new information.