Files
starface-outlook-sync-addin/node_modules/@fluentui/react-hooks/lib-amd/usePrevious.js
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

18 lines
677 B
JavaScript

define(["require", "exports", "react"], function (require, exports, React) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usePrevious = usePrevious;
/**
* Hook keeping track of a given value from a previous execution of the component the Hook is used in.
*
* See [React Hooks FAQ](https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state)
*/
function usePrevious(value) {
var ref = React.useRef(undefined);
React.useEffect(function () {
ref.current = value;
});
return ref.current;
}
});
//# sourceMappingURL=usePrevious.js.map