React.memo vs useMemo
React.memo and useMemo both optimize React performance, but they operate at different levels. React.memo wraps an entire component and prevents it from re-rendering if its props haven’t changed (it’s a component-level memoization tool). Think: “don’t redraw this UI block unless inputs change.” In contrast, useMemo is inside a component and memoizes the result of a calculation or value, so expensive computations aren’t re-run on every render (it’s a value-level optimization). Think: “don’t recompute this derived value unless dependencies change.”
In short:
React.memo → avoids re-rendering components
useMemo → avoids re-computing values inside components













