TGViewer
Web Development Web Development @webdevcoursefree ยท 79.7K subscribers
Post #3405 4.42K
โœ… React.js Essentials โš›๏ธ๐Ÿ”ฅ

React.js is a JavaScript library for building user interfaces, especially single-page apps. Created by Meta, it focuses on components, speed, and interactivity.

1๏ธโƒฃ What is React?
React lets you build reusable UI components and update the DOM efficiently using a virtual DOM.

Why Use React?
โ€ข Reusable components
โ€ข Faster performance with virtual DOM
โ€ข Great for building SPAs (Single Page Applications)
โ€ข Strong community and ecosystem

2๏ธโƒฃ Key Concepts

๐Ÿ“ฆ Components โ€“ Reusable, independent pieces of UI.
function Welcome() {
return <h1>Hello, React!</h1>;
}

๐Ÿง  Props โ€“ Pass data to components
function Greet(props) {
return <h2>Hello, {props.name}!</h2>;
}
<Greet name="Riya" />

๐Ÿ’ก State โ€“ Store and manage data in a component
import { useState } from 'react';

function Counter() {
const [count, setCount] = useState(0);
return (
<>
<p>Count: {count}</p>
<button onClick={() => setCount(count + 1)}>Add</button>
</>
);
}

3๏ธโƒฃ Hooks

useState โ€“ Manage local state
useEffect โ€“ Run side effects (like API calls, DOM updates)
import { useEffect } from 'react';

useEffect(() => {
console.log("Component mounted");
}, []);

4๏ธโƒฃ JSX
JSX lets you write HTML inside JS.
const element = <h1>Hello World</h1>;

5๏ธโƒฃ Conditional Rendering
{isLoggedIn ? <Dashboard /> : <Login />}

6๏ธโƒฃ Lists and Keys
const items = ["Apple", "Banana"];
items.map((item, index) => <li key={index}>{item}</li>);

7๏ธโƒฃ Event Handling
<button onClick={handleClick}>Click Me</button>

8๏ธโƒฃ Form Handling
<input value={name} onChange={(e) => setName(e.target.value)} />

9๏ธโƒฃ React Router (Bonus)
To handle multiple pages
npm install react-router-dom

import { BrowserRouter, Route, Routes } from 'react-router-dom';


๐Ÿ›  Practice Tasks
โœ… Build a counter
โœ… Make a TODO app using state
โœ… Fetch and display API data
โœ… Try routing between 2 pages

๐Ÿ’ฌ Tap โค๏ธ for more
  • โค 10
More from @webdevcoursefree
  1. Oct 16, 2026๐——๐—ฎ๐˜๐—ฎ ๐˜€๐—ฐ๐—ถ๐—ฒ๐—ป๐—ฐ๐—ฒ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ช๐—ถ๐˜๐—ต ๐—”๐—œ๐Ÿ˜ Future Ready Data Scienโ€ฆ
  2. Oct 16, 2026๐ŸŒ Web Development Roadmap โ€” Part 18 HTML Lists Lists are used whenever information needsโ€ฆ
  3. Oct 14, 2026๐ŸŒ Web Development Roadmap โ€” Part 17 HTML Images โ€” <img> Tag Images make webpages more visโ€ฆ
  4. Oct 13, 2026๐—ง๐—ข๐—ฃ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐—ง๐—ข ๐—•๐—ข๐—ข๐—ฆ๐—ง ๐—ฌ๐—ข๐—จ๐—ฅ ๐—ฆ๐—ž๐—œ๐—Ÿ๐—Ÿ๐—ฆ ๐—œ๐—ก ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ! Explorโ€ฆ
  5. Oct 12, 2026For example: Go to Profile โ†’ <a> Submit Form โ†’ <button> Open Article โ†’ <a> Delete Accountโ€ฆ
  6. Oct 12, 2026๐ŸŒ Web Development Roadmap โ€” Part 16 HTML Links โ€” Tag Links are one of the most importantโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’