Page MenuHomec4science

usePreviousProps.js
No OneTemporary

File Metadata

Created
Mon, Jan 27, 08:18

usePreviousProps.js

import * as React from 'react';
const usePreviousProps = value => {
const ref = React.useRef({});
React.useEffect(() => {
ref.current = value;
});
return ref.current;
};
export default usePreviousProps;

Event Timeline