mirror of
https://github.com/plankanban/planka.git
synced 2025-12-18 01:11:13 +03:00
Initial commit
This commit is contained in:
11
client/src/hooks/use-previous.js
Normal file
11
client/src/hooks/use-previous.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
export default (value) => {
|
||||
const prevValue = useRef();
|
||||
|
||||
useEffect(() => {
|
||||
prevValue.current = value;
|
||||
}, [value]);
|
||||
|
||||
return prevValue.current;
|
||||
};
|
||||
Reference in New Issue
Block a user