Question 4 of 10Pro Only
What is the difference between useMemo and useCallback? Why is referential stability important for React performance?
Sample answer preview
useMemo and useCallback are both memoization hooks, but they memoize different things. useMemo memoizes a calculated value. useCallback memoizes a function itself. The fundamental difference is as follows.
useCallbackuseMemoreferential equalityReact.memomemoizationperformance