Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

282 B
Raw Blame
import { useEffect, useRef } from 'react';

// customHook to get previous value of a prop... see prevProps for class components
export default function usePrevious (value) {
  const ref = useRef();
  useEffect(() => {
    ref.current = value;
  }, [value]);
  return ref.current;
}