UNPKG

@yamada-ui/react

Version:

React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion

22 lines (18 loc) 444 B
"use client"; import { useEffect, useRef } from "react"; //#region src/hooks/use-previous/index.ts /** * `usePrevious` is a custom hook for obtaining the previous value. * * @see https://yamada-ui.com/docs/hooks/use-previous */ const usePrevious = (value) => { const ref = useRef(void 0); useEffect(() => { ref.current = value; }, [value]); return ref.current; }; //#endregion export { usePrevious }; //# sourceMappingURL=index.js.map