After installing, open Command Prompt / Terminal and check:
node -v npm -v
Example Output:
v20.10.0 10.2.3
Download: code.visualstudio.com
| ES7 React Snippets | Auto Rename Tag |
| Prettier | Live Server |
npx create-react-app myapp
npx: Runs package installer
create-react-app: Tool to create React project
myapp: Your project name
Go into project folder:
cd myapp
Start the project:
npm start
Browser opens: http://localhost:3000
| File | Purpose |
|---|---|
| index.js | Entry point |
| App.js | Main component |
| App.css | Styling |
React.js is a JavaScript Library used to build User Interfaces (UI) using components.
Developed by Meta (Facebook).
App
|
-----------
| |
Header Content
|
-----------
| |
Card1 Card2
Explanation: React breaks the UI into small, reusable components.
Rule 1: Component names must start with Capital Letter (e.g., Header).
Rule 2: Components must return one parent element.
Rule 3: Use className instead of class.
Rule 4: Use JSX (HTML inside JavaScript).
function App() {
return (
<h1>Hello React</h1>
);
}
export default App;
| Code | Meaning |
|---|---|
| function App() | Component |
| return | UI Output |
| export default | Allows reuse |
| Feature | HTML | JS | React |
|---|---|---|---|
| Type | Markup | Programming | Library |
| UI | Static | Dynamic | Component-based |
| Reuse | No | Limited | Yes |
HTML → CSS → JavaScript → React Setup
→ Components → JSX → Props → State → Hooks