Part 01 / Topic 1 of 8
What React actually is
React is a JavaScript library (not a framework - more on that distinction below) for building user interfaces out of reusable pieces called components. Before React, updating a page meant writing DOM code by hand: find the element, read its current content, decide what changed, patch exactly that part. React flips this: you describe what the UI should look like right now, for the current data, and React works out what changed in the real DOM and updates only that.
Real-world example: Flipkart's product listing page, Swiggy's live order-tracking screen, and Zerodha's trading dashboard are all built this way - a tree of small components, each describing its own little piece of the screen, re-describing itself whenever its data changes.
| Term | What it means here |
|---|---|
| Library, not framework | You still choose your own routing, build tool and project structure (this course uses Vite, then React Router in Stage 4). A framework like Next.js makes more of those choices for you. |
| Declarative | You write "a list item for each item in cart," not "loop over the DOM nodes and patch the ones that changed." |
| Component | A reusable, named piece of UI - a function, as section 6 shows. |
| Virtual DOM / reconciliation | React keeps its own lightweight description of the UI in memory, compares the new description to the last one, and only touches the real DOM where they differ. You will not write code against this directly in this course, but it is why describing the whole UI on every render is fast enough to be practical. |
๐ Going deeper: "Virtual DOM" is an implementation detail of how React keeps renders fast, not something this course asks you to reason about by hand. What matters for everyday work is the mental model in section 7: a render is React calling your component function and getting back a description of the UI for right now.
Done here? The practice set for Part 1 โ including the solutions โ is on the part page.