How does useMemo differ from useCallback?
Both useMemo and useCallback are used for memoization in React, but they serve different purposes:
useMemomemoizes the result of a function, meaning it stores the result of a computation.useCallbackmemoizes a function itself, ensuring that a function reference is stable and does not change unless its dependencies change.
Can we use useMemo and useCallback interchangeably?