← All Questions

React Interview Questions

Interview questions covering react fundamentals.

01

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
02

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
03

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
04

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.

react
05

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.

react
06

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.

react
07

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.

react
08

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.

react
09

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.

react
10

useEffect vs useLayoutEffect

useEffect vs useLayoutEffect in React, explained with diagrams: when each runs, how useLayoutEffect prevents flicker, and when you should use it.

react