React NotesRohit’s interview study guide

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
Start readingWhat React is and why it existsChapter 01 · React Fundamentals
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.10 topics02Components & 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.9 topics03State & 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.11 topics04Class 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.7 topics05EffectsuseEffect 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.10 topics06Refs, 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.8 topics07Hooks 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.10 topics08Context & 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.12 topics09Data 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.11 topics10PerformanceWhat 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.14 topics11Concurrent 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.6 topics12React 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.9 topics13FormsControlled 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.6 topics14RoutingHow 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.10 topics15StylingThe 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.8 topics16Rendering 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.8 topics17TypeScript 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.9 topics18Patterns & 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.10 topics19Error 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.5 topics20TestingHow 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.9 topics21Review QuestionsTest yourself: interview-style questions across the whole site, with worked answers.5 topics

Added marks topics that weren’t in my original doc. Tick Learned on a topic to track what you’ve revised.

Sync progress across devices

Type the same private phrase on your Mac and your phone, and your Learned ticks follow you between them — on every study site.

The phrase never leaves this device: only a fingerprint of it is sent, and the server stores a fingerprint of that. Anyone who knows the phrase could see or change your ticks, so pick something you don’t use elsewhere.

Sync is on in this browser.

Sync ID

This ID must be the same on every device. If another device shows a different one, its phrase is different (capital letters count): tap “Turn off here” on it and type the phrase again exactly.