SeeReactHome ↗
THE REACT LEARNING LIBRARY

Every topic.
One place to learn.

Choose a topic, follow the colored flow, then compare what changes in another example. Open the official reference when you want to go deeper.

178 visual labs178/178 topics visualizedDetailed diagrams. Clear cause and effect.

Coverage follows the official Learn and Reference navigation. Each lab introduces a topic through a guided conceptual model; the linked documentation contains the complete API details and caveats. Experimental and legacy topics are identified separately.

178 results

Visual lab · Learn React

Components

Same code. Separate lives.

Visual lab · Learn React

JSX

Expressions become UI.

Visual lab · Learn React

Props

One value. Two components.

Visual lab · React reference

State

A component with memory.

Visual lab · Learn React

Events

One click. A chain of events.

Visual lab · Learn React

Rendering

Render is not repaint.

Visual lab · Rules and linting

Hooks

Same calls. Remembered values.

Visual lab · React reference

Effects

Commit. Clean up. Set up.

Visual lab · React reference

Context

A value across the tree.

Visual lab · React reference

Refs

Remember without rendering.

Visual lab · React reference

Performance

A render you can skip.

Visual lab · Learn React

Conditional rendering

One condition chooses which UI to describe.

Visual lab · Learn React

Lists and keys

Keys connect an item to its component identity.

Visual lab · Learn React

State snapshots

A handler keeps the values from its own render.

Visual lab · Learn React

State update queues

A queue explains why three updates can mean +1 or +3.

Visual lab · Learn React

Updating objects

Replace an object while preserving the previous snapshot.

Visual lab · Learn React

Updating arrays

Create the next collection instead of editing state in place.

Visual lab · Learn React

Sharing state

Move shared information to the closest common owner.

Visual lab · Learn React

Preserving and resetting state

Type, position and key determine which state belongs to a component.

Visual lab · Learn React

Reducers

An action describes what happened; a reducer computes next state.

Visual lab · Learn React

You might not need an Effect

Calculate display values directly from existing state.

Visual lab · Learn React

Effect dependencies

Changed dependencies replace an old synchronization with a new one.

Visual lab · Learn React

Custom Hooks

Share a stateful recipe while keeping each call independent.

Visual lab · React reference

StrictMode checks

Development checks reveal missing cleanup before users encounter it.

Visual lab · React reference

Suspense boundaries

A boundary provides UI while supported child work is pending.

Visual lab · React reference

Transitions

Urgent input can interrupt non-blocking rendering work.

Visual lab · React DOM

Hydration

Connect React to HTML that was already rendered on the server.

Visual lab · React DOM

Portals

DOM placement can change without changing React ancestry.

Visual lab · React DOM

Hooks

A nested submit control reads its parent form’s submission status.

Visual lab · React DOM

useFormStatus

A nested submit control reads its parent form’s submission status.

Visual lab · React DOM

Components

HTML and SVG elements describe browser UI through React props.

Visual lab · React DOM

Common (e.g. <div>)

Common props connect browser elements to styles, accessibility and events.

Visual lab · React DOM

<form>

A form gathers named controls and submits their values.

Visual lab · React DOM

<input>

A controlled field displays its React value; user edits must update that value.

Visual lab · React DOM

<textarea>

A controlled field displays its React value; user edits must update that value.

Visual lab · React DOM

<select>

A controlled field displays its React value; user edits must update that value.

Visual lab · React DOM

<option>

An option supplies a value for its parent select control.

Visual lab · React DOM

<progress>

A progress indicator distinguishes known completion from unknown duration.

Visual lab · React DOM

<title>

Document metadata describes the page outside its visible content.

Visual lab · React DOM

<meta>

Document metadata describes the page outside its visible content.

Visual lab · React DOM

<link>

A stylesheet link can participate in React’s resource ordering.

Visual lab · React DOM

<style>

An inline stylesheet can be managed as a named document resource.

Visual lab · React DOM

<script>

Async external scripts can be managed as document resources.

Visual lab · React DOM

APIs

Browser-specific APIs connect React with DOM placement and synchronous integrations.

Visual lab · React DOM

browser

A browser-only boundary avoids rendering browser-dependent content on the server.

Visual lab · React DOM

flushSync

Flush a state update before a synchronous browser integration continues.

Visual lab · React DOM

prefetchDNS

prefetchDNS requests earlier dns lookup for a resource the page expects to need.

Visual lab · React DOM

preconnect

preconnect requests earlier connection setup for a resource the page expects to need.

Visual lab · React DOM

preload

preload requests earlier resource fetch for a resource the page expects to need.

Visual lab · React DOM

preloadModule

preloadModule requests earlier module fetch for a resource the page expects to need.

Visual lab · React DOM

preinit

preinit requests earlier fetch and apply css for a resource the page expects to need.

Visual lab · React DOM

preinitModule

preinitModule requests earlier fetch and evaluate for a resource the page expects to need.

Visual lab · React DOM

Client APIs

A client root lets React own the content of a browser container.

Visual lab · React DOM

createRoot

A client root lets React own the content of a browser container.

Visual lab · Server React

renderToPipeableStream

renderToPipeableStream sends HTML through a Node.js stream.

Visual lab · Server React

renderToReadableStream

renderToReadableStream sends HTML through a Web stream.

Visual lab · Server React

renderToString

Generate an HTML string from a React tree without incremental streaming.

Visual lab · Server React

renderToStaticMarkup

Generate an HTML string from a React tree without incremental streaming.

Visual lab · Server React

Server APIs

Server rendering produces HTML; the chosen API determines streaming and waiting behavior.

Visual lab · Server React

prerender

Prerendering waits for supported data to produce a static prelude.

Visual lab · Server React

prerenderToNodeStream

Prerendering waits for supported data to produce a static prelude.

Visual lab · Server React

resume

Continue matching postponed rendering work using its saved state.

Visual lab · Server React

resumeToPipeableStream

Continue matching postponed rendering work using its saved state.

Visual lab · Server React

resumeAndPrerender

Continue matching postponed rendering work using its saved state.

Visual lab · Server React

resumeAndPrerenderToNodeStream

Continue matching postponed rendering work using its saved state.

Visual lab · Server React

Static APIs

Static rendering prepares HTML ahead of delivery and can preserve postponed work.

Visual lab · Server React

Server Components

Server Components run outside the client bundle and pass renderable results across a boundary.

Visual lab · Server React

Server Functions

A Server Function lets client code request an async operation on the server.

Visual lab · Server React

'use server'

A Server Function lets client code request an async operation on the server.

Visual lab · Server React

Directives

A client directive marks a module boundary rather than a DOM subtree.

Visual lab · Server React

'use client'

A client directive marks a module boundary rather than a DOM subtree.

Visual lab · Learn React

Quick Start

Components describe the screen, and state connects interactions to fresh UI.

Visual lab · Learn React

Tutorial: Tic-Tac-Toe

Immutable move snapshots let a game preserve history and reject invalid moves.

Visual lab · Learn React

Thinking in React

Choose minimal state in a common owner and derive the visible view from it.

Visual lab · Learn React

Installation

Start in a sandbox to learn, or prepare a local toolchain for a project.

Visual lab · Learn React

Creating a React App

A framework supplies application infrastructure and can support different rendering strategies.

Visual lab · Learn React

Build a React App from Scratch

A build tool handles modules and JSX while you choose application features such as routing.

Visual lab · Learn React

Add React to an Existing Project

Mount React in a chosen container to adopt it without replacing every existing page.

Visual lab · Learn React

Setup

Editor checks and runtime inspection answer different questions about a React project.

Visual lab · Learn React

Editor Setup

Linting finds suspicious code and formatting makes code layout consistent.

Visual lab · Learn React

Using TypeScript

Type annotations describe component contracts and narrow the values your code can use.

Visual lab · Learn React

React Developer Tools

React DevTools reveals component data and records rendering activity to guide debugging.

Visual lab · Learn React

Describing the UI

A component combines data and JSX to describe the UI for a particular situation.

Visual lab · Learn React

Importing and Exporting Components

Module exports determine the import syntax that makes a component available elsewhere.

Visual lab · Learn React

Writing Markup with JSX

JSX groups UI into a JavaScript expression and uses explicit tag and attribute syntax.

Visual lab · Learn React

Keeping Components Pure

Pure rendering calculates JSX without changing values that existed before the render.

Visual lab · Learn React

Your UI as a Tree

The render tree shows component parents while the module tree shows file dependencies.

Visual lab · Learn React

Adding Interactivity

Event handlers request state changes, and each handler reads the state snapshot from its render.

Visual lab · Learn React

State: A Component's Memory

State remembers a value between renders and a setter requests an updated screen.

Visual lab · Learn React

Managing State

Put coordinated values in one owner and derive each dependent view from that state.

Visual lab · Learn React

Reacting to Input with State

Describe form states explicitly and derive controls from the current state.

Visual lab · Learn React

Choosing the State Structure

Store the smallest consistent facts and calculate information that follows from them.

Visual lab · Learn React

Passing Data Deeply with Context

A consumer reads the closest matching provider above it, or the context default if none exists.

Visual lab · Learn React

Scaling Up with Reducer and Context

Context distributes shared state and dispatch while a reducer centralizes state transitions.

Visual lab · Learn React

Escape Hatches

Refs reach imperative browser capabilities and Effects synchronize external systems with rendered state.

Visual lab · Learn React

Referencing Values with Refs

A ref retains mutable information without making its changes trigger rendering.

Visual lab · Learn React

Manipulating the DOM with Refs

A DOM ref gives event handlers access to mounted elements for focus, scrolling, or measurement.

Visual lab · Learn React

Synchronizing with Effects

Effects start synchronization after commit and clean up before restarting with changed dependencies.

Visual lab · Learn React

Separating Events from Effects

Event handlers respond to interactions while Effects follow reactive values and Effect Events read current nonreactive data.

Visual lab · Learn React

Removing Effect Dependencies

Change Effect code to remove unnecessary reactive inputs instead of suppressing dependency checks.

Visual lab · Compiler

React Compiler

React Compiler adds automatic memoization during your build.

Visual lab · Compiler

Introduction

The compiler optimizes React components and Hooks rather than every JavaScript function.

Visual lab · Compiler

Installation

Install the compiler in the build path before other Babel transformations.

Visual lab · Compiler

Incremental Adoption

Incremental adoption limits which files or functions the compiler processes.

Visual lab · Compiler

Debugging and Troubleshooting

Compare compiled and uncompiled behavior to isolate a compiler-related issue.

Visual lab · Compiler

Configuration

Compiler options separately control selection, compatibility, and error handling.

Visual lab · Compiler

compilationMode

compilationMode decides which functions are candidates for optimization.

Visual lab · Compiler

gating

gating emits original and optimized versions and selects one with an imported boolean function.

Visual lab · Compiler

logger

logger exposes build-time compiler events for coverage and diagnostics.

Visual lab · Compiler

panicThreshold

panicThreshold decides whether compiler diagnostics stop the build.

Visual lab · Compiler

target

target selects the compiler runtime compatible with your React major version.

Visual lab · Compiler

Directives

Compiler directives give a function explicit opt-in or opt-out behavior.

Visual lab · Compiler

"use memo"

use memo explicitly marks a function for compiler analysis.

Visual lab · Compiler

"use no memo"

use no memo temporarily excludes a function from compiler optimization.

Visual lab · Compiler

Compiling Libraries

Library authors can ship compiled code with compatible runtime dependencies.

Visual lab · Developer tools

React Performance tracks

React Performance tracks add React context to supported browser performance recordings.

Visual lab · Rules and linting

Lints

The Hooks ESLint plugin checks both React rules and compiler diagnostics.

Visual lab · Rules and linting

exhaustive-deps

exhaustive-deps finds reactive values omitted from Hook dependency arrays.

Visual lab · Rules and linting

rules-of-hooks

rules-of-hooks checks that ordinary Hooks are called consistently from React functions.

Visual lab · Rules and linting

component-hook-factories

component-hook-factories discourages functions that manufacture nested component or Hook definitions.

Visual lab · Rules and linting

config

config diagnoses invalid compiler option names and values.

Visual lab · Rules and linting

error-boundaries

error-boundaries warns when try/catch is used to handle a child rendering error.

Visual lab · Rules and linting

gating

The gating lint validates the module and export used for compiler feature flags.

Visual lab · Rules and linting

globals

globals flags writes to shared values during rendering.

Visual lab · Rules and linting

immutability

immutability catches changes to props and state that should be treated as snapshots.

Visual lab · Rules and linting

incompatible-library

incompatible-library identifies known APIs whose changing results are unsafe to memoize by function identity.

Visual lab · Rules and linting

preserve-manual-memoization

preserve-manual-memoization checks whether compiler inference preserves existing memoization.

Visual lab · Rules and linting

purity

purity catches known nondeterministic calls in rendering.

Visual lab · Rules and linting

refs

refs checks render-time reads and writes of values inferred to be refs.

Visual lab · Rules and linting

set-state-in-effect

set-state-in-effect identifies avoidable synchronous state updates inside Effects.

Visual lab · Rules and linting

set-state-in-render

set-state-in-render rejects unconditional state setters in rendering.

Visual lab · Rules and linting

static-components

static-components catches component types recreated during another component render.

Visual lab · Rules and linting

unsupported-syntax

unsupported-syntax identifies JavaScript constructs the compiler cannot safely analyze.

Visual lab · Rules and linting

use-memo

use-memo detects useMemo callbacks that forget to return a value.

Visual lab · Rules and linting

Overview

The Rules of React make rendering predictable and state ownership explicit.

Visual lab · Rules and linting

Components and Hooks must be pure

Pure rendering may mutate fresh local data but must not mutate data shared between renders.

Visual lab · Rules and linting

React calls Components and Hooks

JSX lets React own component identity and decide when component functions run.

Visual lab · React reference

Overview

The reference separates component features from platform rendering and build tools.

Visual lab · React reference

Hooks

Hooks connect function components to state, context, refs, and synchronization.

Visual lab · React reference

useActionState

useActionState carries each Action result into the next Action invocation.

Visual lab · React reference

useCallback

useCallback preserves a function identity while its dependencies stay equal.

Visual lab · React reference

useDebugValue

useDebugValue gives a custom Hook a readable label in React DevTools.

Visual lab · React reference

useDeferredValue

useDeferredValue lets a less urgent view temporarily use an older value.

Visual lab · React reference

useEffectEvent

useEffectEvent reads current values in Effect callbacks without making those reads reactive.

Visual lab · React reference

useId

useId generates an instance-specific identifier for accessible relationships.

Visual lab · React reference

useImperativeHandle

useImperativeHandle exposes selected imperative methods through a component ref.

Visual lab · React reference

useInsertionEffect

useInsertionEffect gives styling libraries a place to install CSS before layout Effects.

Visual lab · React reference

useLayoutEffect

useLayoutEffect can measure committed layout and update before the browser paints.

Visual lab · React reference

useMemo

useMemo caches a calculated value until a dependency changes.

Visual lab · React reference

useOptimistic

useOptimistic shows a temporary value while an Action settles the authoritative value.

Visual lab · React reference

useReducer

useReducer routes actions through a pure function to calculate the next state.

Visual lab · React reference

useSyncExternalStore

useSyncExternalStore subscribes React to a store that lives outside React state.

Visual lab · React reference

Components

Built-in components change how React groups, reveals, and observes a subtree.

Visual lab · React reference

<Fragment> (<>)

Fragment groups children without inserting an extra DOM element.

Visual lab · React reference

<Profiler>

Profiler reports commit-related rendering measurements for a chosen subtree.

Visual lab · React reference

<Activity>

Activity hides a subtree while retaining its state and cleaning up its Effects.

Visual lab · React reference

<ViewTransition>

ViewTransition animates participating DOM changes triggered by Transitions or Suspense.

Visual lab · React reference

APIs

React APIs provide reusable building blocks outside the ordinary Hook lifecycle.

Visual lab · React reference

act

await act groups test interactions and flushes their React updates before assertions.

Visual lab · React reference

addTransitionType

addTransitionType tags a Transition so its cause can select animation styling.

Visual lab · React reference

cache

cache shares a function result for matching arguments during a Server Component render request.

Visual lab · React reference

cacheSignal

cacheSignal exposes when the current server render cache lifetime ends.

Visual lab · React reference

captureOwnerStack

captureOwnerStack provides development diagnostics about the components that created an element.

Visual lab · React reference

createContext

createContext defines a channel whose nearest provider supplies descendant values.

Visual lab · React reference

lazy

lazy waits for a loader’s default component and reuses the loaded result.

Visual lab · React reference

startTransition

startTransition marks state updates as interruptible background rendering work.

Visual lab · React reference

use

use reads a Promise or context and integrates pending Promises with Suspense.

Visual lab · Experimental

experimental_taintObjectReference

Tainting an object reference blocks that particular instance from crossing to Client Components.

Visual lab · Experimental

experimental_taintUniqueValue

Tainting a unique value blocks that exact value while its lifetime object remains reachable.

Visual lab · Legacy React

Legacy React APIs

Legacy APIs remain documented for existing code while newer code usually uses functions and Hooks.

Visual lab · Legacy React

Children

Children inspects the received children structure without rendering nested components.

Visual lab · Legacy React

cloneElement

cloneElement creates a new element by shallowly overriding props on an existing element.

Visual lab · Legacy React

Component

Component defines class-based UI with instance props, state, and lifecycle methods.

Visual lab · Legacy React

createElement

createElement describes a React element without using JSX syntax.

Visual lab · Legacy React

createRef

createRef creates a mutable ref object commonly stored on a class instance.

Visual lab · Legacy React

forwardRef

forwardRef passes a parent ref through a function component to a chosen target.

Visual lab · Legacy React

isValidElement

isValidElement checks for a React element rather than every value React can render.

Visual lab · Legacy React

PureComponent

PureComponent shallowly compares class props and state to skip unchanged work.