@razorpay/blade
Version:
The Design System that powers Razorpay
18 lines (15 loc) • 489 B
JavaScript
import { useRef, useEffect } from 'react';
/**
* a type-safe version of the `usePrevious` hook described here:
* @see {@link https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state}
* @deprecated This utility will be deprecated in subsequent version.
*/
function usePrevious(value) {
var ref = useRef();
useEffect(function () {
ref.current = value;
}, [value]);
return ref.current;
}
export { usePrevious };
//# sourceMappingURL=usePrevious.js.map