Last updated: June 26, 2026
10 of 10 questions
It encapsulates one concern, returns a stable, minimal API, follows the Rules of Hooks, and is composable and independently testable.
Profile first, find the bottleneck, then fix the cause — usually unstable props, state placed too high, or large lists — before reaching for memoisation.
Virtualization renders only the visible rows of a long list plus a small buffer, keeping the DOM small and scrolling smooth for thousands of items.
Related components share implicit state via Context so consumers compose them flexibly, like <Tabs><Tab/></Tabs>, without prop drilling configuration.
Use local state by default, Context for low-frequency global values, a server-state library for remote data, and a client store only for complex shared UI state.
It customises the ref a parent receives, exposing a controlled imperative API (focus, scrollTo) instead of the raw DOM node — used sparingly.
Tearing is when a single render shows inconsistent values from an external store because rendering was interrupted; useSyncExternalStore prevents it.
Place granular error boundaries around independent regions, pair them with Suspense for loading states, and handle async/event errors locally.
Portals render children into a different DOM node outside the parent hierarchy while keeping React context and events — ideal for modals and tooltips.
Test behaviour from the user’s perspective with React Testing Library — query by role/text, interact, and assert visible output, not implementation details.
Upload your resume and get an instant ATS score with keyword gaps — free, no sign-up.
React Interview Questions
50 questions
Next.js Interview Questions
10 questions
JavaScript Interview Questions