Reference equality determines whether two values are the same object or function, not whether their contents merely look alike. JavaScript primitives compare by represented value with strict equality, while objects, arrays, and functions compare by identity: {} !== {}, and [] !== []. section 3.3
React uses reference equality when checking nonempty dependency arrays. A single changed dependency reruns the hook; an omitted array runs after every render, and an empty array runs only on mount apart from cleanup on unmount. section 3.3
Memoization can preserve a value's reference between renders as well as avoid repeated work. useMemo recalculates only when its dependencies change, while useCallback provides the same pattern for functions. section 3.2.4
Memoizing a filtered employee list
const filteredList = useMemo( () => employeeList.filter(({ isTemporary }) => showTempOnly ? isTemporary : true ), [employeeList, showTempOnly] ); The filtered array is recomputed when either the source array or the filter changes; otherwise, useMemo returns the previous value reference. section 3.2.4



