beginner · javascript

Hooks-First React Fundamentals

A foundations-first introduction to React for JavaScript developers, covering component composition, JSX, state, effects, events, forms, routing concepts, and reusable patterns. Learners develop the ability to reason about React's rendering model and build maintainable interactive interfaces.

What you could build

  • A searchable catalog with reusable item cards and filtered results
  • A multi-step form with validation and controlled inputs
  • A dashboard with loading, error, and empty states
  • A tabbed interface with shared state and URL-based navigation
  • A sortable data table with pagination and derived state

You pick the project at the start — these are examples, not a fixed list.

What you'll be able to do

  • Explain how React renders a component from its props and state, including snapshots, batching, element identity, and the render-versus-commit distinction.
  • Choose state ownership, model interface state with minimal data, derive values during rendering, and use reducers or state-machine thinking when transitions become complex.
  • Decide whether logic belongs in an event handler or an effect, and reason about dependencies, cleanup, request lifecycles, and stale asynchronous responses.
  • Design controlled forms with semantic structure, validation, FormData, reusable field components, children, slot props, and compound components.
  • Evaluate when to use props, context, reducers, composition, feature boundaries, and route boundaries by comparing coupling, cohesion, reuse, and change impact.

Who this is for

JavaScript developers who know the language basics and want a principled understanding of React rather than a collection of recipes. It fits learners who want to reason about rendering, state, effects, forms, shared state, routing boundaries, and maintainable component architecture.

What you should already know

  • Comfort with JavaScript functions, objects, arrays, modules, and asynchronous code.
  • Basic familiarity with HTML elements, forms, events, and CSS selectors.
  • Some experience reading or writing small JavaScript programs; prior React experience is helpful but not required.

How a lesson actually goes

Lesson 1
TutorWelcome to Hooks-First React Fundamentals. We will begin by building a mental model of React, then use it to reason about state, effects, forms, shared state, and architecture. Before we start, how would you currently explain what a React component does?
YouI think a component is like a reusable HTML section. It receives props, and it can change when state changes, but I am not fully sure what React is recalculating.
TutorThat is a useful starting point. React components do produce interface descriptions, but the key question is what determines that description: a component calculates UI from its current props and state. Let us make that concrete with a component that receives a name prop and displays a greeting.
YouSo if the name is Mina, it returns something like a heading saying Hello, Mina. If the name changes, React runs the component again?
TutorExactly. The component function is evaluated with the new input, producing a new description of the UI; React then compares that result with the previous one before committing necessary changes. Notice that the component is not directly modifying the heading—it is calculating what the heading should be.
TutorNow consider a component with a count state value. On a render where count is 2, what value should the component observe throughout that render if an event later requests an update to 3?

Written from this course's first lesson to show the format — not a recording of a real session.

Course content

marks each module's capstone lesson.

01React Mental Models11 lessons

Build a foundations-first understanding of how React represents interfaces, renders components, propagates data, preserves identity, updates state, and synchronizes with external systems.

  • Course Introduction

    Welcome and orientation: overview of the learning path, key outcomes, and how modules build on each other.

  • UI as a Function

    React treats rendering as a calculation that maps inputs to a description of the interface. This model helps distinguish describing UI from causing external changes.

  • Component Trees

    React interfaces are organized as trees of nested components. A component's position in that tree determines how it participates in rendering and data flow.

  • Props

    Props are values passed from a parent to a child component. They allow a component to render differently based on its inputs without directly changing those inputs.

  • One-Way Data Flow

    React conventionally moves data down the component tree through props. Children communicate upward by invoking functions supplied by their parents rather than directly mutating parent data.

  • State Snapshots

    State values are associated with renders, so an event handler observes the snapshot from the render that created it. Updating state requests a later render rather than changing the current snapshot in place.

  • Update Batching

    React may batch state updates before rendering again. Understanding batching clarifies why repeated direct updates can use the same snapshot and when updater functions are necessary.

  • Element Identity

    React preserves or resets component state based on an element's identity in the rendered tree. Keys provide stable identity when rendering collections or changing sibling positions.

  • Commit Phase

    React first calculates what the interface should look like and then commits necessary changes to the DOM or another host environment. This separation explains why rendering should remain free of external side effects.

  • Effects as Synchronization

    Effects run after React commits a render and are used to synchronize with systems outside React. Their dependencies describe which reactive values require the synchronization to be repeated.

  • Mental Model Synthesis

    Synthesize the core React mental models to predict what renders, which state is preserved, when updates are applied, and whether synchronization with an external system is required.

02Stateful Interfaces9 lessons

Learn how to design, represent, update, and share interface state in React. This module connects state ownership, state modeling, controlled inputs, reducers, and state machines into a coherent approach for reasoning about interactive interfaces.

  • State Ownership

    State ownership identifies the component responsible for storing and changing a value. Choosing an appropriate owner keeps data flow understandable and makes state available to the components that need it.

  • State Modeling

    State modeling is the process of choosing values that fully describe an interface condition without encoding unnecessary or contradictory information. A good model makes valid states clear and updates predictable.

  • Derived Values

    Derived values are computed from existing props or state. Calculating them during rendering avoids synchronization problems caused by storing information that can be determined from another source.

  • Functional Updates

    A functional update supplies React with a function that receives the latest state and returns the next state. This form remains reliable when updates are batched or when several updates are queued before another render.

  • Lifting State

    Lifting state places a shared value in a parent and passes the value and update mechanism through props. This creates one source of truth while preserving React's one-way data flow.

  • Controlled Inputs

    A controlled input receives its current value from React and reports user edits through an event handler. React state therefore remains the authoritative representation of the input's value.

  • Reducers

    A reducer centralizes state transition logic in a function that receives the current state and an action. Reducers are useful when many related transitions need explicit, consistent rules.

  • State Machines

    A state machine describes named interface states, the events that can occur, and the transitions allowed between them. Making these rules explicit helps prevent impossible combinations and unhandled interaction paths.

  • Stateful Interface Synthesis

    This capstone assessment synthesizes the module's approach to stateful interfaces. It requires reasoning from component structure and user events to state ownership, controlled values, update strategy, and valid state transitions.

03Effects and Data9 lessons

Learn how React effects synchronize components with external systems and how asynchronous data moves through a component over time. This module covers effect setup, dependencies, cleanup, event boundaries, request lifecycles, and race conditions.

  • Effect Setup

    An effect runs after React commits a render, allowing a component to synchronize with an external system. Learners distinguish the render calculation from the side effect that follows it.

  • Effect Dependencies

    The dependency array declares which reactive values an effect reads and uses to determine when synchronization must be repeated. Learners analyze how dependency changes relate to renders and effect execution.

  • Effect Cleanup

    An effect may return a cleanup function that removes subscriptions, timers, listeners, or other external connections. Cleanup runs before an effect is replaced and when the component is removed.

  • Events Versus Effects

    Event handlers respond to a specific interaction, while effects respond to committed renders and synchronize with external systems. Learners use the cause of an operation to place logic in the correct boundary.

  • Data Fetching

    Data fetching effects start a request when relevant inputs change and update component state when a response arrives. Learners trace the relationship between request inputs, effect dependencies, and rendered data.

  • Request Lifecycles

    A request can move through states such as idle, pending, fulfilled, and rejected. Learners connect each phase to the data a component should render and the transitions that cause those phases.

  • Stale Responses

    A response from an earlier request can arrive after a newer request and overwrite current data. Learners reason about request identity and cleanup-based guards that prevent obsolete responses from winning.

  • Effect Abstraction

    A custom hook packages effect logic, dependencies, cleanup, and state transitions behind a focused interface. Learners identify which implementation details can be hidden while preserving the hook's reactive inputs and returned data.

  • Effects and Data Synthesis

    Learners synthesize the module's concepts to trace how a component responds to changing inputs, starts and replaces synchronization, represents asynchronous data, and protects current state from obsolete work.

04Forms and Composition10 lessons

Learn how React represents form values, handles submission, validates user input, and composes reusable interface structures. This module connects form behavior with children, slots, field components, and compound component patterns.

  • Form Semantics

    Semantic form elements give browsers and assistive technologies meaningful structure. Labels associate readable descriptions with controls and support reliable interaction.

  • Controlled Form Fields

    A controlled field uses React state as the source of truth for its current value. User input is handled as an event that requests a state update, which produces the next rendered value.

  • Submission Events

    Form submission is an event boundary where the interface can interpret the current form state and decide what should happen next. Preventing the default action keeps control of the interaction in the React interface.

  • FormData

    FormData provides a browser representation of successful form controls at submission time. Its entries are determined by control names, values, and whether controls participate in submission.

  • Form Validation

    Validation evaluates whether current input satisfies the rules required by the interface. Feedback should represent the relevant validation state without confusing it with the act of submitting the form.

  • Field Components

    A field component can coordinate a label, control, description, and validation message while exposing the inputs needed to customize that structure. Encapsulation reduces repetition without hiding the field's essential data flow.

  • Children Composition

    The children prop represents content placed between a component's opening and closing tags. Rendering children lets a component provide structure while allowing its parent to choose the nested content.

  • Slot Props

    Slot props give a component multiple named places where callers can provide content. They make the component's composition API more explicit than relying on one undifferentiated children value.

  • Compound Components

    Compound components divide a coordinated interface into related pieces that are composed together by the caller. The parent establishes shared meaning and coordination while the pieces expose focused roles.

  • Forms and Composition Synthesis

    Synthesize form and composition concepts to reason about how a reusable interface represents controls, processes user input, validates values, handles submission, and exposes flexible structural extension points.

05Shared State Patterns9 lessons

Learn how React components share state across a tree without losing clear ownership or predictable data flow. This module covers prop drilling, context, provider scope, context updates, value design, and reducer-based context patterns.

  • Prop Drilling

    Prop drilling occurs when values travel through several component layers to reach a distant consumer. Recognizing this pattern helps distinguish ordinary composition from a need for another sharing strategy.

  • Context

    Context represents a value that can be read by components within a particular subtree. It provides an alternative to manually threading certain shared values through each component boundary.

  • Provider Scope

    A provider establishes a context value for the subtree beneath it. When providers are nested, a consumer reads from the nearest matching provider in its rendered ancestry.

  • Context Consumption

    A component consumes context by reading the value associated with the nearest provider, commonly through the useContext hook. The value becomes an input to that component's render calculation.

  • Context Updates

    When a provider's context value changes, components consuming that context are notified and can render again with the new value. This update relationship is separate from passing a changed prop through each intermediary.

  • Context Value Design

    A context value should have a clear, focused shape rather than becoming an unrestricted container for unrelated state. Designing the value deliberately makes dependencies visible and limits unnecessary coupling between consumers.

  • Context Splitting

    Context splitting places distinct shared concerns in separate contexts instead of combining them into one broad value. Consumers can then subscribe only to the concern they require.

  • Reducer Context

    A reducer can centralize transitions for shared state while context makes the current state and update mechanism available to descendants. This pattern separates transition rules from the components that request those transitions.

  • Shared State Synthesis

    Shared state requires a deliberate relationship between ownership, component boundaries, consumers, and updates. This synthesis connects prop drilling, context scope, consumption, update behavior, value design, context splitting, and reducer context into one reasoning model.

06React Architecture9 lessons

Learn how to organize React interfaces into clear component, feature, and dependency boundaries. This module connects component contracts, composition, domain logic, route boundaries, and architectural tradeoffs into a maintainable structure.

  • Architectural Boundaries

    Architectural boundaries define which parts of an interface own rendering, state coordination, data access, and shared behavior. Clear boundaries make relationships between parts of a React system easier to understand and change.

  • Component Contracts

    A component contract describes the props, children, events, and behavioral expectations that a component exposes to its consumers. Explicit contracts allow components to be reused without requiring consumers to understand their internal implementation.

  • Composition

    Composition lets components receive and arrange other components or content through props such as children and named slots. It preserves flexibility by allowing structure and behavior to be combined at the point of use.

  • Dependency Direction

    Dependency direction describes which parts of an architecture are allowed to know about or depend on other parts. A stable direction keeps lower-level concerns from depending on higher-level interface details and limits the spread of change.

  • Feature Modules

    Feature modules group code according to the capability it supports rather than only according to technical file type. This organization makes a feature's internal relationships visible and helps keep unrelated concerns from becoming entangled.

  • Domain Logic

    Domain logic expresses rules and transformations that can often be reasoned about independently of React rendering. Separating those rules from components reduces component complexity and makes behavior easier to reuse and test conceptually.

  • Route Boundaries

    A route boundary represents a navigable section of an interface and can coordinate the components, data, and layout associated with that section. Treating routes as architectural boundaries helps distinguish page-level responsibilities from reusable interface pieces.

  • Architecture Tradeoffs

    React architecture involves tradeoffs rather than one universally correct arrangement. Evaluating a structure requires considering how responsibilities are grouped, how dependencies flow, how much reuse is justified, and where future changes are likely to occur.

  • Architecture Synthesis

    Architectural synthesis connects local component decisions to the structure of the wider React system. A sound analysis explains how responsibilities are divided, how information and dependencies move, and whether the resulting boundaries support clarity, reuse, and controlled change.

Questions

Do I need prior React experience?

No. The course starts with React's mental model and introduces JSX, components, props, state, effects, and composition in sequence. JavaScript fundamentals are assumed.

Does the course cover hooks beyond useState and useEffect?

It focuses deeply on useState, useEffect, reducers, and custom hooks, using them to explain stateful interfaces, synchronization, data flows, and reusable behavior.

Will I learn how to fetch data safely in React?

Yes. You will reason about effect dependencies, cleanup, request phases, and stale responses, including when an asynchronous result should no longer update component state.

How much attention is given to forms?

A full module covers semantic forms, controlled fields, submission events, FormData, validation, reusable field components, children, slot props, and compound components.

Does the course teach routing?

It covers routing concepts and route boundaries, including how page-level composition, data needs, feature ownership, and URL-based navigation fit into a React architecture.

Is this mainly a coding syntax course?

No. Syntax is used in service of understanding React's rendering model and architectural tradeoffs. Assessments emphasize predicting behavior, choosing appropriate patterns, and explaining why a design works.

The first lesson is ten minutes away.

Free while codeset is early. You choose what you're building before the first lesson starts, and the course is taught around it.

Start this course

Other courses