UseCallback & UseMemo — A Side Note to the Official Doc

The following can be read as a side reference to the official React Doc:



const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);
const List = useMemo(
() => => ({
itemProp1: expensiveFunction(props.first),
itemProp2: anotherPriceyFunction(props.second)

So what’s the difference between useCallback and useMemo?

useCallback(fn, deps);
useMemo(fn, deps);

Hi :)