Outlook_Addin_LLM/node_modules/@fluentui/react-utilities/lib/hooks/usePrevious.js

13 lines
240 B
JavaScript
Raw Normal View History

import * as React from 'react';
/**
* @internal
*/ export const usePrevious = (value)=>{
const ref = React.useRef(null);
React.useEffect(()=>{
ref.current = value;
}, [
value
]);
return ref.current;
};