@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
24 lines (20 loc) • 595 B
JavaScript
"use client";
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
let react = require("react");
react = require_rolldown_runtime.__toESM(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 = (0, react.useRef)(void 0);
(0, react.useEffect)(() => {
ref.current = value;
}, [value]);
return ref.current;
};
//#endregion
exports.usePrevious = usePrevious;
//# sourceMappingURL=index.cjs.map