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

14 lines
463 B
JavaScript

import * as React from 'react';
/**
* 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)
*/
export function usePrevious(value) {
var ref = React.useRef(undefined);
React.useEffect(function () {
ref.current = value;
});
return ref.current;
}
//# sourceMappingURL=usePrevious.js.map