Interview study guide
React, old and new.
Everything from my React interview doc, organised by topic and filled in. Written for React 19.3, with the class-component and pre-hooks ways explained alongside, and every example run and tested in a real React project.
- Chapters
- 21
- Topics
- 187
- Code samples
- 530
- Added beyond the doc
- 58
01React FundamentalsWhat React is, what JSX compiles to, how the Virtual DOM and reconciliation decide what to change, one-way data flow, mounting an app, StrictMode, project setup and how React got from 16 to 19.3.02Components & PropsFunction components, props and children, composition over inheritance, default values and PropTypes old and new, fragments, conditional rendering, lists and keys, and how to design components other people can reuse.03State & EventsState vs props, useState, batching, functional updates and stale closures, immutability and Immer, events and the synthetic event system, lifting state up, controlled vs uncontrolled inputs, and deciding where state should live.04Class Components & LifecycleThe "old" React: classes,
this.state, setState, the lifecycle methods and how each one maps to hooks — still asked in interviews, still in older codebases, and still the only way to write an error boundary.05EffectsuseEffect from the ground up: when effects run, dependency arrays, cleanup, infinite loops, async code and race conditions, Strict Mode's double run, useLayoutEffect, useEffectEvent, and when not to use an effect at all.06Refs, the DOM & PortalsuseRef for DOM access and for values that survive renders, forwardRef (React 18 and earlier) versus ref as a prop (React 19), useImperativeHandle, callback refs with React 19's ref cleanup, and portals for modals and tooltips.07Hooks In Depth & Custom HooksThe rules of hooks and why they exist, useReducer, useContext, useId and useSyncExternalStore, then writing your own hooks — useFetch with AbortController, useDebounce/useThrottle, useLocalStorage — and how React stores hook state under the hood.08Context & State ManagementSharing state without prop drilling: the Context API and its re-render rules, Context with useReducer, then Redux from the ground up — classic Redux and connect, Redux Thunk explained slowly, Redux Toolkit 2 with createSlice, createAsyncThunk and RTK Query — plus Redux Saga, Zustand 5, and how to choose.09Data Fetching & Server StateGetting data from a server into components: by hand with effects, then with TanStack Query 5 (queries, keys, caching, mutations, optimistic updates, infinite lists), React 19's use() with Suspense, and live data over WebSockets and Server-Sent Events.10PerformanceWhat makes React re-render, how memo, useMemo, useCallback and the React Compiler skip work, how to measure before you optimise, and the browser-level techniques (virtualisation, code splitting, bundle size, debouncing, workers, idle time, layout) that keep big apps fast.11Concurrent React & SuspenseHow React 18+ can prepare a new screen in the background without freezing the current one: concurrent rendering, useTransition, useDeferredValue, Suspense boundaries, React 19.2's <Activity>, and why external stores need useSyncExternalStore.12React 19 FeaturesWhat React 19 (December 2024) added and removed, and what 19.1, 19.2 and 19.3 (September 2026) added on top: Actions, useActionState, form actions, useOptimistic, use(), document metadata, and the upgrade traps.13FormsControlled forms, validation by hand, React Hook Form, schema validation with Zod, and React 19's form actions — what each approach costs and when to pick it.14RoutingHow a single-page app changes pages without reloading, React Router 8 from <BrowserRouter> to data routers with loaders and actions, protected and lazy routes, and TanStack Router's type-safe params and route loaders.15StylingThe ways to style React components — inline styles, global CSS, CSS Modules, styled-components, Tailwind and component libraries like MUI — what each one actually generates, what CSS-in-JS costs at runtime, and how to choose.16Rendering Strategies, SSR & Server ComponentsWhere and when React turns components into HTML — CSR, SSR, SSG and ISR — server rendering with react-dom/server, hydration and its mismatches, streaming, SEO, React Server Components with 'use client' and 'use server', and the Next.js 16 App Router.17TypeScript with ReactTyping props, children, state, events, refs, context, generic components, defaults, higher-order components and custom hooks — for React 19.3 with TypeScript 7 and @types/react 19.3, and what changed from React 18's types.18Patterns & ArchitectureReusing logic with higher-order components, render props and hooks; compound and container/presentational components; structuring projects from small apps to enterprise monorepos; building a component library with Storybook; and micro-frontends with Module Federation.19Error HandlingError boundaries and what they can't catch, react-error-boundary 6, React 19's root error callbacks, and handling errors from event handlers and async code — with React 19.3's real console output.20TestingHow to test React the way users use it: Vitest and React Testing Library for components and hooks, user-event for interactions, MSW for the network, and Cypress or Playwright for whole flows in a real browser.21Review QuestionsTest yourself: interview-style questions across the whole site, with worked answers.Added marks topics that weren’t in my original doc. Tick Learned on a topic to track what you’ve revised.