React
Components, hooks, rendering and the frameworks built on top of React.
2026
- Observe sibling nodes with Fragment refsAttach one IntersectionObserver to sibling elements with a React Fragment ref and keep both list items direct children of their list.
- Slide forward and back with addTransitionTypeTag React navigation updates with addTransitionType so forward and back use different slide directions, even when they lead to the same screen.
- Animate route changes with React ViewTransitionUse React ViewTransition to fade between client-side routes and carry a shared cover from a catalog thumbnail into its detail view.
- Check your React Server Components patchesCheck the deployed Next.js or React Server Components package versions against the initial security fixes and later advisories.
- Why React Compiler 1.0 skips componentsRead React Compiler diagnostics in ESLint, then check the build log to confirm which components compile after you fix the reported line.
- Remove useMemo and useCallback under the compilerCheck which components React Compiler optimizes and which effects depend on memoized values before removing useMemo or useCallback.
- Read current props with useEffectEventRead the latest props in an Effect Event while keeping a React subscription tied to its real dependencies.
- Abort stale server fetches with cacheSignalPass React cacheSignal to a Server Component fetch so pending work can stop when its render ends.
- Keep tab drafts with React ActivityHide a React editor with Activity, keep the draft in memory, and let React clean up Effects while the editor is hidden.
- Read React's Chrome DevTools performance tracksRecord a slow click in Chrome DevTools, read React's Blocking lane in the Scheduler track, and trace the Render span to a component.
- Call server functions from TanStack Start loadersRead a server-only file with createServerFn and use the typed result in a TanStack Start route loader.
- Pass ref as a prop in ReactRemove forwardRef from a React 19 input wrapper while keeping the DOM node that existing callers expect.
- Add optimistic UI with useOptimisticShow a like while a React action saves it and return to the confirmed value if the request fails.
- Stream comments with React use()Pass a promise from a Server Component and let a Suspense boundary handle the wait while the rest of the page renders.
- Render a React context as its providerRender a context object as a provider in React 19 and keep the same value, readers and nested overrides.
- Render document metadata from React componentsSet a route’s title and description next to its data with React 19 document metadata.
- Preload a font and initialize a scriptUse preload for a font and preinit for a classic script that can execute as soon as it downloads.
- Handle form errors with useActionStateReturn field errors from a React form action and keep the submitted input available for a retry.
- Return cleanup functions from ref callbacksAttach a ResizeObserver with a React 19 callback ref, return its disconnect function, and test setup and cleanup when the element unmounts.
- Where to put the React client boundaryPut 'use client' on the interactive leaf of a Server Component page and pass serializable props from the server module.