when a or b is changed // only keep track of one previous value (and inputs) const memoizedValue = useMemo(() => compute(a, b), [a, b]); // never updated const memoizedValue = useMemo(() => compute(x, y), []); // can memoize anything, including a component tree const child = useMemo(() => <Child a={a} />, [a]); // cache tool for inline function const memoizedCallback = useCallback(() => {...}, inputs); // means const memoizedCallback = useMemo(() => () => {...}, inputs);