siegel
Version:
Web application development ecosystem
12 lines (11 loc) • 449 B
TypeScript
declare const symbolPrevValue: unique symbol;
/**
* Memoize given value to retrieve it at the next component render
*
* @param value Value to retrieve at the next render
* @param ref Optional reusable ref created with React.useRef
* @returns previous value or undefined if it's first render
*/
declare function usePrevious(value: any, ref?: import("react").MutableRefObject<null>): any;
export default usePrevious;
export { symbolPrevValue };