React Fundamentals
This chapter follows state through render and commit, explains identity and reconciliation, then applies effects, controlled inputs, composition, lazy boundaries, and recoverable errors.
- Explain JSX & components by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Props, state & useEffect by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Suspense & error boundaries by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Rendering edge cases by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Trace the chapter's complete execution path and identify where memory, I/O, concurrency, persistence, or rendering cost accumulates.
How to use this chapter
For React Fundamentals, read the explanations first and predict every example before running it. Keep a learning repository containing code, tests, command output, and the short written submission. The roadmap checklist at the end audits coverage; the chapter itself follows the frontend learning arc appropriate to this subject.
The problem this chapter solves
This chapter follows state through render and commit, explains identity and reconciliation, then applies effects, controlled inputs, composition, lazy boundaries, and recoverable errors.
Declarative components make UI updates predictable and composable while the ecosystem handles routing, caching, forms, validation, and build optimization.
Learning outcomes
- Explain JSX & components by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Props, state & useEffect by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Suspense & error boundaries by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Rendering edge cases by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Trace the chapter's complete execution path and identify where memory, I/O, concurrency, persistence, or rendering cost accumulates.
- Build the worked example, make one failure visible, and defend the design in a review.
Chapter progression
The order below is intentional: later sections depend on guarantees established earlier.
Runtime or system overview
A render computes an element tree. Reconciliation compares identities and schedules DOM work; commit applies changes and effects. State setters enqueue updates, and React may batch, interrupt, or repeat rendering. Effects run after commit and therefore synchronize with external systems rather than calculate render data. In React Fundamentals, use that execution model to decide where the chapter's validation, state ownership, cleanup, and evidence belong.
Execution trace
- A user or server response schedules a state, cache, or navigation update; React calls affected components to compute a new element tree.
- Reconciliation compares element type, position, and key to preserve or replace component identity and its hook state.
- The commit phase applies DOM changes; layout work and passive effects run in their defined phases, cleaning up the previous external subscription first.
- Server Components or route handlers perform server work, while client boundaries hydrate serializable props and streaming segments reveal completed UI incrementally.
- Tests assert accessible output, loading/error/empty states, cleanup, cancellation, stale-response protection, and render or bundle performance.
Memory and performance lens
Hook state is associated with a component's position and identity in the rendered tree. Closures capture values from one render. Unremoved listeners, timers, subscriptions, object URLs, and caches can retain memory after the visible UI changes. For React Fundamentals, connect those costs to the concrete operations in the topic sections rather than assuming the friendly surface syntax is cheap.
When tuning React Fundamentals, measure accessible interaction success, render count, main-thread time, bundle size, layout shift, request cancellation, and Web Vitals rather than optimizing from source-code appearance.
1. JSX & components
The JSX & components unit begins with JSX transpilation to React.createElement: JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. Use stable domain IDs as keys and compose with children. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
State, identity, and user experience: JSX & components
| Concept | Meaning | Engineering decision |
|---|---|---|
| JSX transpilation to React.createElement | JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. | Use stable domain IDs as keys and compose with children. |
| functional components + props destructuring | JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. | Use stable domain IDs as keys and compose with children. |
| children prop and composition pattern | JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. | Use stable domain IDs as keys and compose with children. |
| controlled vs uncontrolled components | JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. | Use stable domain IDs as keys and compose with children. |
| key prop and reconciliation | JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. | Use stable domain IDs as keys and compose with children. |
Render and browser lifecycle: JSX & components
JSX transpilation to React.createElement. The compiler transforms JSX to runtime calls; React reconciles element type and key, preserves or resets component state, and commits minimal host changes.
functional components + props destructuring. The compiler transforms JSX to runtime calls; React reconciles element type and key, preserves or resets component state, and commits minimal host changes.
children prop and composition pattern. The compiler transforms JSX to runtime calls; React reconciles element type and key, preserves or resets component state, and commits minimal host changes.
controlled vs uncontrolled components. The compiler transforms JSX to runtime calls; React reconciles element type and key, preserves or resets component state, and commits minimal host changes.
key prop and reconciliation. The compiler transforms JSX to runtime calls; React reconciles element type and key, preserves or resets component state, and commits minimal host changes.
Read these as one system: JSX transpilation to React.createElement establishes the starting contract, functional components + props destructuring changes how that contract is executed or represented, and key prop and reconciliation exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Bugs users actually experience: JSX & components
| Risk | Why it matters |
|---|---|
| JSX transpilation to React.createElement | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. |
| functional components + props destructuring | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. |
| children prop and composition pattern | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. |
| controlled vs uncontrolled components | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. |
| key prop and reconciliation | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. |
UI implementation lab: JSX & components
- Foundation: implement or demonstrate JSX transpilation to React.createElement with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine JSX transpilation to React.createElement with functional components + props destructuring. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for key prop and reconciliation. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
2. Props, state & useEffect
The Props, state & useEffect unit begins with useState: initial value/updater/batching (React 18): JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. Use stable domain IDs as keys and compose with children. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
State, identity, and user experience: Props, state & useEffect
| Concept | Meaning | Engineering decision |
|---|---|---|
| useState: initial value/updater/batching (React 18) | JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. | Use stable domain IDs as keys and compose with children. |
| lifting state up and prop drilling problem | JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. | Use stable domain IDs as keys and compose with children. |
| immutable state updates (spread/Array methods) | JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. | Use stable domain IDs as keys and compose with children. |
| useEffect dependencies, cleanup, common mistakes (stale closure/infinite loop) | A closure is a function that retains bindings from an enclosing lexical scope after that outer call returns. | Use closures for configured callbacks and small stateful factories. |
| useLayoutEffect vs useEffect | JSX is syntax for element descriptions; components map props and state to those descriptions. Keys define sibling identity across renders. | Use stable domain IDs as keys and compose with children. |
Render and browser lifecycle: Props, state & useEffect
useState: initial value/updater/batching (React 18). The compiler transforms JSX to runtime calls; React reconciles element type and key, preserves or resets component state, and commits minimal host changes.
lifting state up and prop drilling problem. The compiler transforms JSX to runtime calls; React reconciles element type and key, preserves or resets component state, and commits minimal host changes.
immutable state updates (spread/Array methods). The compiler transforms JSX to runtime calls; React reconciles element type and key, preserves or resets component state, and commits minimal host changes.
useEffect dependencies, cleanup, common mistakes (stale closure/infinite loop). The captured values live in cells referenced by the inner function; they remain reachable as long as the closure remains reachable.
useLayoutEffect vs useEffect. The compiler transforms JSX to runtime calls; React reconciles element type and key, preserves or resets component state, and commits minimal host changes.
Read these as one system: useState: initial value/updater/batching (React 18) establishes the starting contract, lifting state up and prop drilling problem changes how that contract is executed or represented, and useLayoutEffect vs useEffect exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Component behavior in context: Props, state & useEffect
1const [value, setValue] = useState(() => initialValue);This Props, state & useEffect slice makes useState: initial value/updater/batching (React 18) observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward useLayoutEffect vs useEffect, predict its behavior for empty, invalid, repeated, and large input.
Bugs users actually experience: Props, state & useEffect
| Risk | Why it matters |
|---|---|
| useState: initial value/updater/batching (React 18) | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. |
| lifting state up and prop drilling problem | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. |
| immutable state updates (spread/Array methods) | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. |
| useEffect dependencies, cleanup, common mistakes (stale closure/infinite loop) | Late binding in loops captures the variable, not its historical value; bind a default argument when needed. |
| useLayoutEffect vs useEffect | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. |
UI implementation lab: Props, state & useEffect
- Foundation: implement or demonstrate useState: initial value/updater/batching (React 18) with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine useState: initial value/updater/batching (React 18) with lifting state up and prop drilling problem. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for useLayoutEffect vs useEffect. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
3. Suspense & error boundaries
The Suspense & error boundaries unit begins with && vs ternary vs early return patterns: Suspense displays a fallback while a descendant is pending; error boundaries replace a failed render subtree with recovery UI. Place boundaries around meaningful product regions and preserve retry paths. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
State, identity, and user experience: Suspense & error boundaries
| Concept | Meaning | Engineering decision |
|---|---|---|
| && vs ternary vs early return patterns | Suspense displays a fallback while a descendant is pending; error boundaries replace a failed render subtree with recovery UI. | Place boundaries around meaningful product regions and preserve retry paths. |
| React.lazy + Suspense for code splitting | Suspense displays a fallback while a descendant is pending; error boundaries replace a failed render subtree with recovery UI. | Place boundaries around meaningful product regions and preserve retry paths. |
| Error boundary class component | Suspense displays a fallback while a descendant is pending; error boundaries replace a failed render subtree with recovery UI. | Place boundaries around meaningful product regions and preserve retry paths. |
| react-error-boundary library | Suspense displays a fallback while a descendant is pending; error boundaries replace a failed render subtree with recovery UI. | Place boundaries around meaningful product regions and preserve retry paths. |
Render and browser lifecycle: Suspense & error boundaries
&& vs ternary vs early return patterns. Lazy loading throws a promise-like suspension to the nearest boundary; render errors propagate to a class/error-boundary integration, not to ordinary try/catch around JSX.
React.lazy + Suspense for code splitting. Lazy loading throws a promise-like suspension to the nearest boundary; render errors propagate to a class/error-boundary integration, not to ordinary try/catch around JSX.
Error boundary class component. Lazy loading throws a promise-like suspension to the nearest boundary; render errors propagate to a class/error-boundary integration, not to ordinary try/catch around JSX.
react-error-boundary library. Lazy loading throws a promise-like suspension to the nearest boundary; render errors propagate to a class/error-boundary integration, not to ordinary try/catch around JSX.
Read these as one system: && vs ternary vs early return patterns establishes the starting contract, React.lazy + Suspense for code splitting changes how that contract is executed or represented, and react-error-boundary library exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Bugs users actually experience: Suspense & error boundaries
| Risk | Why it matters |
|---|---|
| && vs ternary vs early return patterns | Suspense does not automatically handle every client fetch library or event-handler exception. |
| React.lazy + Suspense for code splitting | Suspense does not automatically handle every client fetch library or event-handler exception. |
| Error boundary class component | Suspense does not automatically handle every client fetch library or event-handler exception. |
| react-error-boundary library | Suspense does not automatically handle every client fetch library or event-handler exception. |
UI implementation lab: Suspense & error boundaries
- Foundation: implement or demonstrate && vs ternary vs early return patterns with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine && vs ternary vs early return patterns with React.lazy + Suspense for code splitting. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for react-error-boundary library. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
4. Rendering edge cases
The Rendering edge cases unit begins with Fragment and keyed Fragment: A React Fragment groups siblings without adding a DOM element; a keyed Fragment gives that group stable sibling identity during reconciliation. Use a keyed Fragment when one list item must return several sibling elements without an unnecessary wrapper. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
State, identity, and user experience: Rendering edge cases
| Concept | Meaning | Engineering decision |
|---|---|---|
| Fragment and keyed Fragment | A React Fragment groups siblings without adding a DOM element; a keyed Fragment gives that group stable sibling identity during reconciliation. | Use a keyed Fragment when one list item must return several sibling elements without an unnecessary wrapper. |
| derived state anti-pattern | Derived state is data that can be calculated from current props, state, or query results; storing a second synchronized copy creates competing sources of truth. | Store the minimal user-controlled source state and derive totals, filtered lists, labels, and validity during render. |
| Strict Mode development double invoke | React Strict Mode intentionally re-runs selected render and effect lifecycles in development to expose impure rendering and missing cleanup. | Keep render pure and make effects symmetrical: acquire an external resource, then return cleanup that releases exactly that resource. |
| event handler errors vs Error Boundaries | Error Boundaries catch render, constructor, and lifecycle errors below them; they do not automatically catch exceptions thrown later inside event handlers or arbitrary async callbacks. | Place boundaries around recoverable UI regions and handle expected command failures where the event is initiated. |
| Suspense data-source requirements | Suspense displays a fallback while a descendant is pending; error boundaries replace a failed render subtree with recovery UI. | Place boundaries around meaningful product regions and preserve retry paths. |
Render and browser lifecycle: Rendering edge cases
Fragment and keyed Fragment. The JSX fragment shorthand cannot take a key. participates in the same type-and-key identity algorithm as other elements, preserving or resetting descendant state as the keyed group moves.
derived state anti-pattern. Every render can calculate cheap derived values directly or memoize genuinely expensive pure calculations. Copying props into state requires an effect and another render, and updates can arrive in an order that leaves the copy stale.
Strict Mode development double invoke. React mounts, cleans up, and re-runs effects and may call render-related functions twice in development; production does not perform this diagnostic cycle.
event handler errors vs Error Boundaries. Render errors propagate through the fiber tree to the nearest boundary. Event handlers run after commit, so they need local try/catch, rejected-operation state, or a framework error channel.
Suspense data-source requirements. Lazy loading throws a promise-like suspension to the nearest boundary; render errors propagate to a class/error-boundary integration, not to ordinary try/catch around JSX.
Read these as one system: Fragment and keyed Fragment establishes the starting contract, derived state anti-pattern changes how that contract is executed or represented, and Suspense data-source requirements exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Bugs users actually experience: Rendering edge cases
| Risk | Why it matters |
|---|---|
| Fragment and keyed Fragment | An index key or missing key can attach state and focus to the wrong logical group after insertion or reordering. |
| derived state anti-pattern | Synchronizing derived state with useEffect causes flicker, stale values, extra renders, and loops when dependencies are incomplete or unstable. |
| Strict Mode development double invoke | Disabling Strict Mode hides duplicate-subscription and non-idempotent-effect defects that can still appear through remounting or concurrent rendering. |
| event handler errors vs Error Boundaries | Wrapping an entire application in one boundary produces a blank global fallback and still leaves event failures unreported. |
| Suspense data-source requirements | Suspense does not automatically handle every client fetch library or event-handler exception. |
UI implementation lab: Rendering edge cases
- Foundation: implement or demonstrate Fragment and keyed Fragment with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine Fragment and keyed Fragment with derived state anti-pattern. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for Suspense data-source requirements. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
Complete worked example
This example integrates the chapter rather than demonstrating an isolated method.
1import { useEffect, useState } from 'react';2
3type Task = { id: string; title: string; done: boolean };4
5export function TaskList({ initial }: { initial: Task[] }) {6 const [tasks, setTasks] = useState(initial);7
8 useEffect(() => {9 const controller = new AbortController();10 refreshTasks(controller.signal).then(setTasks).catch(error => {11 if (error.name !== 'AbortError') report(error);12 });13 return () => controller.abort();14 }, []);15
16 return <ul>{tasks.map(task => (17 <li key={task.id}>18 <button onClick={() => setTasks(current => current.map(item => item.id === task.id ? { ...item, done: !item.done } : item))}>19 {task.done ? '✓' : '○'} {task.title}20 </button>21 </li>22 ))}</ul>;23}Expected result
1The list preserves state by task ID, updates immutably, and aborts the refresh when unmounted.Line-by-line reading
| Line | Code | Explanation |
|---|---|---|
| 1 | import { useEffect, useState } from 'react'; | Imports the named dependency; import executes the module once per interpreter cache and binds selected names here. |
| 3 | type Task = { id: string; title: string; done: boolean }; | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 5 | export function TaskList({ initial }: { initial: Task[] }) { | Implements the next tsx statement in the example's data flow. |
| 6 | const [tasks, setTasks] = useState(initial); | Binds a JavaScript value used by the component or operation. |
| 8 | useEffect(() => { | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 9 | const controller = new AbortController(); | Binds a JavaScript value used by the component or operation. |
| 10 | refreshTasks(controller.signal).then(setTasks).catch(error => { | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 11 | if (error.name !== 'AbortError') report(error); | Evaluates the condition and enters this branch only when it is truthy. |
| 12 | }); | Implements the next tsx statement in the example's data flow. |
| 13 | return () => controller.abort(); | Returns the observable result to the caller and ends this invocation. |
| 14 | }, []); | Implements the next tsx statement in the example's data flow. |
| 16 | return | Returns the observable result to the caller and ends this invocation. |
| 17 | | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 18 | | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 19 | {task.done ? '✓' : '○'} {task.title} | Implements the next tsx statement in the example's data flow. |
| 20 | | Implements the next tsx statement in the example's data flow. |
| 21 | | Implements the next tsx statement in the example's data flow. |
| 22 | ))}; | Implements the next tsx statement in the example's data flow. |
| 23 | } | Implements the next tsx statement in the example's data flow. |
Step-by-step execution
- A user or server response schedules a state, cache, or navigation update; React calls affected components to compute a new element tree.
- Reconciliation compares element type, position, and key to preserve or replace component identity and its hook state.
- The commit phase applies DOM changes; layout work and passive effects run in their defined phases, cleaning up the previous external subscription first.
- Server Components or route handlers perform server work, while client boundaries hydrate serializable props and streaming segments reveal completed UI incrementally.
- Tests assert accessible output, loading/error/empty states, cleanup, cancellation, stale-response protection, and render or bundle performance.
Common mistakes and professional corrections
| Area | Common failure | Better engineering choice |
|---|---|---|
| JSX & components | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. | Use stable domain IDs as keys and compose with children. |
| Props, state & useEffect | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. | Use stable domain IDs as keys and compose with children. |
| Suspense & error boundaries | Suspense does not automatically handle every client fetch library or event-handler exception. | Place boundaries around meaningful product regions and preserve retry paths. |
| Rendering edge cases | An index key or missing key can attach state and focus to the wrong logical group after insertion or reordering. | Use a keyed Fragment when one list item must return several sibling elements without an unnecessary wrapper. |
Interview and review notes
- Define the central abstraction without naming a library function.
- Trace one request, call, query, message, render, or state transition from input to observable result.
- Compare two alternatives from this chapter by guarantee, cost, and failure behavior.
- Explain the most likely production bug and the test or metric that reveals it.
- State what remains authoritative after process loss, retry, reconnect, or deployment.
Practice set
Easy
- Define every bold term in the concept tables in one precise sentence.
- Reproduce the focused examples and annotate the value or state after each important line.
- Explain the chapter progression diagram aloud in two minutes.
Medium
- Replace one convenient default with an explicit policy for validation, timeout, ordering, pagination, cleanup, or error handling.
- Write a negative test for each topic group.
- Compare the measured behavior before and after one justified change.
Hard
- Combine all topic groups into one thin vertical slice.
- Inject a realistic failure at the most important external boundary and prove recovery.
- Write a one-page design note covering ownership, trade-offs, security, observability, and rollback.
Chapter submission
Submit:
- source code or reproducible commands;
- automated tests plus one deliberately failing-before-fix test;
- captured output, query plan, trace, screenshot, or metric;
- a 300–500 word explanation of the execution flow and one rejected alternative;
- a short README with setup, versions, limitations, and cleanup steps.
- Continue with the React Kanban Board project workshop.
Self-review rubric
| Dimension | Beginning | Competent | Professional |
|---|---|---|---|
| Explanation | Names APIs | Explains behavior | Connects guarantees, internals, and trade-offs |
| Implementation | Happy path only | Validated and tested | Clear ownership, failure recovery, and cleanup |
| Evidence | Manual claim | Repeatable output | Tests plus meaningful measurement or inspection |
| Communication | Steps missing | Reproducible README | Decisions, limits, and alternatives are explicit |
Roadmap coverage checklist
- To do: JSX & components: JSX transpilation to React.createElement
- To do: JSX & components: functional components + props destructuring
- To do: JSX & components: children prop and composition pattern
- To do: JSX & components: controlled vs uncontrolled components
- To do: JSX & components: key prop and reconciliation
- To do: Props, state & useEffect: useState: initial value/updater/batching (React 18)
- To do: Props, state & useEffect: lifting state up and prop drilling problem
- To do: Props, state & useEffect: immutable state updates (spread/Array methods)
- To do: Props, state & useEffect: useEffect dependencies, cleanup, common mistakes (stale closure/infinite loop)
- To do: Props, state & useEffect: useLayoutEffect vs useEffect
- To do: Suspense & error boundaries: && vs ternary vs early return patterns
- To do: Suspense & error boundaries: React.lazy + Suspense for code splitting
- To do: Suspense & error boundaries: Error boundary class component
- To do: Suspense & error boundaries: react-error-boundary library
- To do: Rendering edge cases: Fragment and keyed Fragment
- To do: Rendering edge cases: derived state anti-pattern
- To do: Rendering edge cases: Strict Mode development double invoke
- To do: Rendering edge cases: event handler errors vs Error Boundaries
- To do: Rendering edge cases: Suspense data-source requirements
Quick revision
- JSX & components: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Props, state & useEffect: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Suspense & error boundaries: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Rendering edge cases: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Re-read the worked-example execution trace instead of memorizing isolated syntax.
- If you cannot name the owner of state and cleanup, the design is not yet complete.
Mastery check
How well can you recall this?
Finished this lesson?