Foundations & Mental Model
The idea in one sentence
Section titled “The idea in one sentence”React renders your UI as a function of state: UI = f(state). You don’t manually update the DOM when data changes — you describe what the UI should look like for the current state, and React figures out the minimal DOM changes to get there.
Every advanced topic — hooks, reconciliation, Suspense, the compiler — is a consequence of taking that one equation seriously. Get the model right and the rest follows.
What this module covers
Section titled “What this module covers”| Lesson | What you’ll learn |
|---|---|
| Why React & the model | Declarative vs imperative, and UI = f(state) |
| JSX & elements | What JSX compiles to, and what an element really is |
| Rendering & reconciliation | The render/commit phases, the virtual tree, and keys |
| State snapshot & purity | State as a snapshot, immutability, and why render is pure |
The lens for the whole course
Section titled “The lens for the whole course”Two ideas explain almost everything React does:
flowchart TB f["UI = f(state) (you describe, React updates)"] --> render["Re-render on state change (compute the new tree)"] pure["Render is pure (no side effects, same input same output)"] --> render render --> recon["Reconciliation (diff old vs new, patch the DOM)"]
- Because UI is a function of state, a change to state triggers a re-render — React re-runs your component to compute what the UI should now be.
- Because render is pure, React is free to call it whenever, batch it, restart it, or run it twice (StrictMode) — which is exactly what makes concurrent features possible.
Hold those two and React stops surprising you.