import { useEffect, useRef } from 'react'; // storing a previous version of a prop for comparison
// similar to the old previousProps param from `componentDidUpdate`

var usePrevious = function usePrevious(value) {
  var ref = useRef();
  useEffect(function () {
    ref.current = value;
  });
  return ref.current;
};

export default usePrevious;