Skip to content
Getting StartedChapter 1 / 37Beginner4 min read

Introduction

React.js kya hai, kyun use hoti hai, aur UI Components aur State ke through kaise kaam karti hai, Roman Urdu mein shuruat.

On this page

1. What is it?

Definition

Simple words mein, React UI ko chhote reusable Components mein divide karta hai. Har Component apna specific UI ka kaam karta hai, aur in Components ko combine karke complete application banayi jati hai.

UI = chhote parts ka combination
Navbar
Product Card
Shopping Cart
Footer
Complete UI

React.js JavaScript ecosystem ka part hai aur mainly frontend UI development ke liye use hoti hai.

2. Why does it exist?

Problem kya solve karta hai?

Traditional JavaScript mein complex UI ko manually update karna difficult ho sakta hai, jaise user ke action ke baad multiple UI elements ek saath update karne hon.

Bina ReactReact ke saath
User actionState / data change
DOM manually dhoondhoReact change detect karta hai
Har element khud update karoUI automatically update
Code jaldi complex ho jata haiComponents + state se organize UI
React ka simple flow
State/Data change
React
UI update

React Components aur State ke through complex UI ko organize aur manage karna easier banata hai.

3. Where is it used?

React un jagahon par use hota hai jahan interactive UI chahiye:

AreaReact se kya banaya jata hai
E-commerceProduct cards, cart, filters, checkout UI
DashboardTables, charts, filters, interactive panels
SaaS appsSettings, forms, modals, user dashboards
Social appsPosts, likes, comments, notifications

React ko Next.js jaise frameworks ke andar bhi use kiya jata hai (routing, SSR, aur production setup ke saath).

4. How does it work?

Basic mental model

React ka basic idea ye hai ke UI current data / state ke mutabiq render hoti hai.

User action se UI tak
User Action
State/Data Change
React re-render
UI update

Example: User Like button press karta hai → state change hoti hai → React component dubara render karta hai → updated like count screen par aa jata hai.

5. How do I use it?

React mein UI Components ke form mein likhte hain:

tsx
function Welcome() {
  return <h1>Hello React</h1>;
}

Code kaise kaam kar raha hai?

CheezMatlab
WelcomeEk React Component (reusable UI piece)
return (...)JSX, HTML jaisa syntax jo UI describe karta hai
Screen parHello React heading show hoti hai

Real app mein multiple components combine hote hain:

Component tree (simple)
App
Navbar
ProductList
ProductCard

6. What are common mistakes?

Galati: Ek hi bohot bara Component banana

Why? Code samajhna aur maintain karna mushkil ho jata hai.

Behtar: UI ko chhote, reusable Components mein divide karo, har part ka ek clear kaam ho.

Galati: Har cheez ko State banana

Why? Extra state code confusing banati hai aur kabhi performance par bhi asar karti hai.

Behtar: Sirf wohi data State mein rakho jo UI mein change hota hai; baqi normal variables ya props use karo.

Galati: Props aur State ko mix karna

Why? Dono alag roles play karte hain, galat use se bugs aate hain.

Behtar: Props = parent se aaya hua data; State = is component ka khud ka changing data.

TopicPropsState
Kahan se aata haiParent componentKhud component ke andar
Change kaun karta haiParent (read-only child ke liye)Component khud (user action, API, etc.)
Kab use kareinData pass karna neecheUI jo change ho rahi ho

Galati: React ko sirf HTML likhne ka tareeqa samajhna

Why? Asli faida Components, State, Props aur data-driven UI mein hai.

Behtar: Pehle mental model samjho, JSX syntax baad mein naturally aa jati hai.

7. What comes before / after it?

Learning path

StageTopics
Pehle (Before)HTML/CSS basics, JavaScript basics, functions, arrays & objects, map(), import / export
React ke saath (Related)Components, JSX, Props, State, Events, Hooks
Baad mein (After)API integration, routing, advanced Hooks, Next.js
Suggested order
JavaScript
React.js
Components + JSX
Props + State
Hooks
API Integration
Next.js

Final quick revision

Simple words mein

React.js ek JavaScript library hai jo interactive UI banane ke liye use hoti hai. UI ko Components mein divide kiya jata hai; jab state / data change hoti hai, UI update hoti hai.

Key points

PointDetail
React kya haiUI banane ki JavaScript library
UI structureReusable Components
Update ka triggerState / data change
Components ke beech dataProps