API reference
Every hook, component and API the guide covers, the version it arrived in, and where it is taught. Use it as a checklist before an interview.
77 entries
Hooks
| Name | Since | What it does | Chapter |
|---|---|---|---|
| useState | 16.8 | Component state that triggers a re-render when set. | 12. State |
| useReducer | 16.8 | State updated through a pure reducer function. | 13. useReducer |
| useContext | 16.8 | Read a context value from the nearest provider. | 16. Context |
| useRef | 16.8 | A mutable box that survives renders without causing them. | 14. Refs |
| useImperativeHandle | 16.8 | Customize what a parent gets through a ref. | 14. Refs |
| useEffect | 16.8 | Synchronize with an external system after commit. | 15. Effects |
| useLayoutEffect | 16.8 | Effect that runs before the browser paints. | 15. Effects |
| useInsertionEffect | 18 | Effect for CSS-in-JS libraries to inject styles before layout. | 15. Effects |
| useEffectEvent | 19.2 | A non-reactive event function you can call from an effect. | 15. Effects |
| useMemo | 16.8 | Cache a computed value between renders. | 29. Memoization |
| useCallback | 16.8 | Cache a function identity between renders. | 29. Memoization |
| useTransition | 18 | Mark updates as non-blocking and get a pending flag. | 24. Transitions |
| useDeferredValue | 18 | Let a value lag behind during urgent updates. | 24. Transitions |
| useId | 18 | Stable unique ids that match between server and client. | 17. Custom hooks |
| useSyncExternalStore | 18 | Subscribe to an external store without tearing. | 33. Build a store |
| useDebugValue | 16.8 | Label a custom hook in React DevTools. | 17. Custom hooks |
| useActionState | 19.0 | State updated by an Action, with a pending flag. | 25. Actions |
| useOptimistic | 19.0 | Show an optimistic value while an Action is in flight. | 25. Actions |
Components
| Name | Since | What it does | Chapter |
|---|---|---|---|
| <Fragment> | 16.2 | Group children without a wrapper element. Accepts a ref since 19.3. | 10. Components and props |
| Fragment refs | 19.3 | A FragmentInstance for focus, events and observers over a fragment's children. | 14. Refs |
| <StrictMode> | 16.3 | Development checks that double-invoke renders and effects. | 15. Effects |
| <Suspense> | 16.6 | Show a fallback while children are waiting. | 26. Suspense and use |
| <Profiler> | 16.5 | Measure render timings of a subtree. | 22. Portals and Profiler |
| <Activity> | 19.2 | Hide UI while keeping its state, and pre-render it. | 27. Activity and View Transitions |
| <ViewTransition> | 19.3 | Animate between UI states with the View Transition API. | 27. Activity and View Transitions |
| <Context> as provider | 19.0 | Render a context directly instead of Context.Provider. | 16. Context |
APIs
| Name | Since | What it does | Chapter |
|---|---|---|---|
| use | 19.0 | Read a promise or context during render; can be conditional. | 26. Suspense and use |
| createElement | 0.x | Create a React element. What JSX compiles to (classic runtime). | 3. Elements and JSX |
| jsx() runtime | 17 | The automatic JSX runtime the compiler emits. | 3. Elements and JSX |
| createContext | 16.3 | Create a context object. | 16. Context |
| memo | 16.6 | Skip re-rendering when props are shallow-equal. | 29. Memoization |
| lazy | 16.6 | Load a component's code on first render. | 26. Suspense and use |
| startTransition | 18 | Mark an update as a transition outside components. | 24. Transitions |
| addTransitionType | 19.3 | Tag a transition so view transitions can animate by type. | 27. Activity and View Transitions |
| captureOwnerStack | 19.1 | Read the component owner stack in development. | 21. Errors |
| act | 18.3 | Flush updates and effects in tests (exported from react). | 56. Testing |
react-dom
| Name | Since | What it does | Chapter |
|---|---|---|---|
| useFormStatus | 19.0 | Read the pending state of the parent form (react-dom). | 25. Actions |
| createRoot | 18 | Create a concurrent root and render into a DOM node. | 4. Rendering elements |
| hydrateRoot | 18 | Attach React to server-rendered HTML. | 43. SSR and hydration |
| root error options | 19.0 | onCaughtError, onUncaughtError and onRecoverableError on roots. | 21. Errors |
| createPortal | 16 | Render children into another DOM node. | 22. Portals and Profiler |
| flushSync | 16 | Force React to apply an update synchronously. | 23. Rendering and scheduling |
| preload, preinit, preconnect, prefetchDNS | 19.0 | Tell the browser about resources early. | 43. SSR and hydration |
| requestFormReset | 19.0 | Reset a form after an Action, inside a transition. | 25. Actions |
| Document metadata | 19.0 | <title>, <meta> and <link> rendered anywhere are hoisted to <head>. | 43. SSR and hydration |
| browser() | 19.3 | use(browser()) defers part of a tree to the browser after hydration. | 43. SSR and hydration |
| preinitModule, preloadModule | 19.0 | The same early-resource hints for ES modules. | 43. SSR and hydration |
| <form action={fn}> | 19.0 | Built-in form component: pass a function and React runs it as an Action. | 25. Actions |
| <input>, <select>, <textarea> | 0.x | Built-in form fields, controlled with value and onChange or uncontrolled with defaultValue. | 19. Forms |
| <link>, <script>, <style> | 19.0 | Stylesheets with precedence and async scripts are deduplicated and hoisted. | 43. SSR and hydration |
Server rendering and Server Components
| Name | Since | What it does | Chapter |
|---|---|---|---|
| cache | 19.0 | Memoize a function per server request (Server Components). | 44. Server Components |
| cacheSignal | 19.2 | An AbortSignal for the lifetime of cache() in a request. | 44. Server Components |
| renderToString | 0.x | Legacy synchronous render to HTML. No streaming or Suspense data. | 43. SSR and hydration |
| renderToReadableStream | 18 | Stream HTML in Web Streams environments. | 43. SSR and hydration |
| renderToPipeableStream | 18 | Stream HTML in Node.js. | 43. SSR and hydration |
| prerender | 19.0 | Render to static HTML, waiting for all data (react-dom/static). | 43. SSR and hydration |
| resume and resumeAndPrerender | 19.2 | Finish a partially prerendered shell later. | 43. SSR and hydration |
| prerenderToNodeStream | 19.0 | prerender for Node.js streams (react-dom/static). | 43. SSR and hydration |
| resumeToPipeableStream, resumeAndPrerenderToNodeStream | 19.2 | The Node.js stream versions of resume and resumeAndPrerender. | 43. SSR and hydration |
| renderToStaticMarkup | 0.x | Render non-interactive HTML with no hydration markers, e.g. for emails. | 43. SSR and hydration |
| Taint APIs | experimental | experimental_taintObjectReference and taintUniqueValue keep secrets off the client. | 45. Server Functions |
Directives
| Name | Since | What it does | Chapter |
|---|---|---|---|
| "use client" | 19.0 | Marks the boundary where client components start. | 44. Server Components |
| "use server" | 19.0 | Marks Server Functions callable from the client. | 45. Server Functions |
React Compiler
| Name | Since | What it does | Chapter |
|---|---|---|---|
| babel-plugin-react-compiler | Compiler 1.0 | Automatic memoization at build time. | 30. The React Compiler |
| "use memo" and "use no memo" | Compiler 1.0 | Opt a function into or out of compilation. | 30. The React Compiler |
| eslint-plugin-react-hooks | Compiler 1.0 | Rules of Hooks plus the Compiler's rules (recommended-latest). | 58. Tooling and DX |
Legacy
| Name | Since | What it does | Chapter |
|---|---|---|---|
| forwardRef | 16.3 | Pass a ref through a component. Not needed since ref is a prop in 19. | 14. Refs |
| Component and PureComponent | 0.x | Class components and the shallow-compare base class. | 20. Class components |
| createRef | 16.3 | Ref object for class components. | 20. Class components |
| Children, cloneElement, isValidElement | 0.x | Legacy helpers for inspecting and copying elements. | 20. Class components |
| useFormState | canary | The canary name for useActionState, still exported by react-dom but deprecated. Rename it. | 61. React versions |
| unstable_batchedUpdates | 0.x | Manual batching. Redundant since React 18 batches every update automatically. | 61. React versions |
Next.js
| Name | Since | What it does | Chapter |
|---|---|---|---|
| "use cache", cacheLife, cacheTag | Next 16 | Opt-in caching under Cache Components. | 48. Caching in Next.js |
| revalidateTag, updateTag, refresh | Next 16 | Invalidate cached data after a write. | 48. Caching in Next.js |
| proxy.ts | Next 16 | Request interception, formerly middleware.ts. | 47. Data and mutations in Next.js |
| generateStaticParams | Next 13.4 | Prerender dynamic routes at build time. | 49. Rendering and deploying Next.js |
| after() | Next 15 | Run work after the response is sent. | 47. Data and mutations in Next.js |