React Interview Questions
Interview questions covering react fundamentals.
What is Hydration in React?
React hydration explained with diagrams: how React attaches to server-rendered HTML, what causes hydration mismatch errors, and how to fix them.
React Compiler vs useMemo: Do You Still Need useMemo?
React Compiler vs useMemo explained: what the compiler memoizes for you, what useMemo, useCallback and React.memo do, and when manual memoization still helps.
React Error Boundary for Functional Components
React error boundary for functional components explained: why you need a class or react-error-boundary, what boundaries can't catch, and how to reset them.
React Key Prop and Reconciliation Explained
The React key prop explained with diagrams: how reconciliation matches elements, why index keys break lists, and how to reset state with a key.
Why Does My React Component Re-render?
Why does my React component re-render? Learn the real triggers (state, parent renders, context), why props are not one, and how to stop extra re-renders.
Why React StrictMode Renders Twice (and Why It's Not a Bug)
React Strict Mode explained: why components render twice and effects run twice in development, what bugs it finds, and how to fix them. Not a bug.
Stale Closures in React Hooks: Why Your State Is Old
Stale closure in React explained with diagrams: why setInterval and event handlers see old state, and three fixes: updater functions, dependencies and refs.
useActionState, useOptimistic and useFormStatus Explained
React 19 form hooks explained with diagrams: what useActionState returns, how useOptimistic shows instant updates, and why useFormStatus must sit inside a form.
useEffect Cleanup Function Explained
The React useEffect cleanup function explained with diagrams: when it runs, why effects run twice in StrictMode, and how to fix fetch race conditions.
useEffect vs useLayoutEffect
useEffect vs useLayoutEffect in React, explained with diagrams: when each runs, how useLayoutEffect prevents flicker, and when you should use it.