reload maps every time the select map modal is opened
This commit is contained in:
11
src/helpers/usePrevious.js
Normal file
11
src/helpers/usePrevious.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
function usePrevious(value) {
|
||||
const ref = useRef();
|
||||
useEffect(() => {
|
||||
ref.current = value;
|
||||
}, [value]);
|
||||
return ref.current;
|
||||
}
|
||||
|
||||
export default usePrevious;
|
||||
Reference in New Issue
Block a user