Concurrent Features Overview
Concurrent React: interruptible rendering, transitions, Suspense, and why render purity matters more than ever.
- react
- concurrent-features
Concurrent features let React start rendering an update, pause, abandon, or resume work so the browser can stay responsive. You do not enable a single “concurrent mode” flag in modern React — you use concurrent-capable APIs (createRoot, transitions, Suspense) and write render-safe components.
Docs: Start Transition, Suspense.
Core ideas
- Render can be interruptible — pure render functions are mandatory; side effects belong in effects/events.
- Urgent vs transition updates — typing and clicks stay high priority; heavy filters can be transitions (useTransition, useDeferredValue).
- Suspense coordinates loading UI while content is not ready.
- Streaming SSR can send HTML in chunks as server work completes (framework-dependent).
What you write differently
// Bad under concurrent render: side effect while rendering
function Bad({ id }) {
localStorage.setItem('last', id);
return <div />;
}
// Good
function Good({ id }) {
useEffect(() => {
localStorage.setItem('last', id);
}, [id]);
return <div />;
}
Do not rely on “render runs once.” Strict Mode already double-invokes in dev; concurrent features make purity a runtime requirement.
createRoot
import { createRoot } from 'react-dom/client';
createRoot(document.getElementById('root')).render(<App />);
Legacy ReactDOM.render is the old synchronous path. New apps use createRoot.
Tooling map
| Need | API |
|---|---|
| Non-urgent setState | startTransition / useTransition |
| Lag a value | useDeferredValue |
| Loading UI | Suspense |
| External store safety | useSyncExternalStore |
| Force sync flush (rare) | flushSync |
Interview out-loud
“Concurrent React can interrupt rendering to keep the UI responsive. I keep render pure, mark expensive updates as transitions, use Suspense for loading boundaries, and use createRoot. Concurrent is not a free performance boost — it is a scheduling model that rewards correct data flow.”
Related on this site
Further reading
Edge cases worth rehearsing
Interviewers and production incidents cluster around the same edges: first render versus update, empty and loading states, Strict Mode double setup, concurrent interruptions, and what happens when identity (key, route params, user id) changes mid-edit. Walk one concrete user journey end-to-end — open, edit, navigate away, come back — and say which state survives.
Prefer fixing data flow and ownership before reaching for memoization or micro-optimizations. Prefer event handlers over effects when a user action is the trigger. Prefer deriving values during render over mirroring props into state. Prefer stable list keys from business ids. Measure with the profiler when performance is the claim.
When you cite an API, mention one failure mode: abort on unmount, serializable props across server/client boundaries, focus restoration for dialogs, or cache invalidation after a mutation. Specific beats generic every time.
Edge cases worth rehearsing
Interviewers and production incidents cluster around the same edges: first render versus update, empty and loading states, Strict Mode double setup, concurrent interruptions, and what happens when identity (key, route params, user id) changes mid-edit. Walk one concrete user journey end-to-end — open, edit, navigate away, come back — and say which state survives.
Prefer fixing data flow and ownership before reaching for memoization or micro-optimizations. Prefer event handlers over effects when a user action is the trigger. Prefer deriving values during render over mirroring props into state. Prefer stable list keys from business ids. Measure with the profiler when performance is the claim.
When you cite an API, mention one failure mode: abort on unmount, serializable props across server/client boundaries, focus restoration for dialogs, or cache invalidation after a mutation. Specific beats generic every time.
Related guides
- Accessibility Patterns in ReactPractical React a11y: labels, focus management, keyboard, live regions, and composition patterns that stay accessible.
- Avoid Prop Drilling with CompositionStop threading props through intermediates: children slots, inversion of control, and when context is the right escape hatch.
- Batching State UpdatesHow React 18+ batches setState in events, timeouts, and promises: when updates flush and why double setState still works.
- Children Prop PatternsUsing children and slot props for flexible APIs: wrappers, compound components, and when to prefer explicit props.
- Client Component BoundariesWhere to put use client: push interactivity to leaves, serializable props, and children as server slots.