React Cheat Sheet 2026

The 30 highest-yield React facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.

50 questions
60 min time limit
70% to pass
  1. What happens if you omit the dependency array entirely in useEffect? It runs after every render
  2. What is an Error Boundary in React? A component that catches JavaScript errors in its child tree and renders a fallback
  3. What problem does the useRef hook commonly solve? Holding a mutable value that persists without causing re-renders
  4. What does React.memo do to a functional component? Skips re-rendering if props are unchanged
  5. What does the `defaultValue` prop do on a React input element? Sets the initial value without making the input controlled
  6. What should a data-fetching useEffect return to avoid memory leaks? A cleanup function
  7. What is a portal in React (ReactDOM.createPortal)? A way to render children into a DOM node outside the parent hierarchy
  8. Which of the following is a valid useEffect cleanup? useEffect(() => { return () => clearInterval(id); })
  9. What does the useTransition hook provide? A way to mark state updates as non-urgent transitions
  10. Which built-in hook pair is most commonly combined in a useFetch custom hook? useState and useEffect
  11. What does an Error Boundary catch? Errors thrown during rendering of child components
  12. What does React.lazy enable? Code-splitting by loading a component dynamically
  13. In which phase does useEffect run relative to the browser paint? After the browser has painted
  14. What does useReducer's dispatch function do? Sends an action to the reducer to compute the next state
  15. What is the purpose of the key prop when rendering a list? Help React identify which items changed, added, or removed
  16. Can you use Hooks inside a class component? No, Hooks only work in function components
  17. What does a custom hook typically return? It can return anything: values, functions, arrays, objects, or nothing
  18. Why is over-using useMemo considered an anti-pattern? Memoization itself has overhead; the benefit only justifies complex computations
  19. What does React not include? All of the above
  20. What does the useState hook return? An array with the state value and a setter function
  21. What problem do React Hooks primarily solve? They let function components use state and lifecycle features
  22. What is a useLocalStorage custom hook typically used for? Persisting state to localStorage and syncing it with component state
  23. Why might you wrap a callback in useCallback before passing it to a memoized child? To keep a stable reference so the child doesn't re-render unnecessarily
  24. Why should you never mutate state arrays directly with push() in React? React won't detect the change and may not re-render
  25. How does a useEffect clean up after itself? By returning a cleanup function
  26. After editing a component, how does Vite reflect changes in the browser without a full reload? Hot Module Replacement (HMR)
  27. What does the useContext hook return? The nearest Provider's value prop
  28. What is a custom Hook? A JavaScript function whose name starts with 'use' and that may call other Hooks
  29. What is a React fragment? A wrapper (<> or ) that groups multiple elements without adding extra DOM nodes
  30. Which hook lets you perform side effects in a function component? useEffect
Turn these facts into recall: