UNPKG

480 BTypeScriptView Raw
1import { DependencyList } from 'react';
2/**
3 * Identical to `useMemo` _except_ that it provides a semantic guarantee that
4 * values will not be invalidated unless the dependencies change. This is unlike
5 * the built in `useMemo` which may discard memoized values for performance reasons.
6 *
7 * @param factory A function that returns a value to be memoized
8 * @param deps A dependency array
9 */
10export default function useStableMemo<T>(factory: () => T, deps?: DependencyList): T;