Skip to content

Instantly share code, notes, and snippets.

@gabor-paholics-benestudio
Created April 30, 2021 11:46
function usePrevious(value) {
const ref = useRef();
useEffect(() => {
ref.current = value;
});
return ref.current;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment