rooks
Version:
Essential React custom hooks ⚓ to super charge your components!
14 lines • 562 B
TypeScript
import type { MutableRefObject } from "react";
/**
* useFreshRef
*
* @param value The value which needs to be fresh at all times. Probably
* best used with functions
* @param preferLayoutEffect Should the value be updated using a layout effect
* or a passive effect. Defaults to false.
* @returns A ref containing the fresh value
* @see https://react-hooks.org/docs/useFreshRef
*/
declare function useFreshRef<T>(value: T, preferLayoutEffect?: boolean): MutableRefObject<T>;
export { useFreshRef };
//# sourceMappingURL=useFreshRef.d.ts.map