Q10: What is the difference between useCallback and useMemo?

useCallback memoizes callback function instances across re-renders to maintain reference stability. useMemo memoizes the calculated result value of an expensive function call across re-renders.

Key Takeaways
  • useCallback(fn, deps) returns a memoized function instance.
  • useMemo(() => value, deps) returns a memoized calculated value.
Knowledge Check

Which hook is specifically designed to memoize the computed return value of a heavy calculation?