Introduction
Watch the walkthrough
Open on InstagramQuick revision
React describes an interface as a tree of components. A function component receives props and returns the UI for the current render. React calls it again when relevant state changes, then commits the necessary DOM updates. Keep rendering pure: do not fetch data, start timers, or mutate external objects inside the component body.
- JSX: syntax compiled into JavaScript; it is not an HTML string.
- Props: inputs supplied by a parent. Treat them as read-only.
- State: component memory that changes over time and schedules another render.
- Composition: build a page by nesting smaller components with clear responsibilities.
Follow the repository example
App.js returns the starter screen; index.js connects React to the HTML root. Trace this entry point before adding components. The example uses Create React App, so its scripts and build output differ from a Vite or Next.js project.
Recall check
Why does changing an ordinary local variable not update the screen? It neither persists as component state nor requests another render. Use a state setter for data that affects the UI.
Reference: React Quick Start.