text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.usePrevious = usePrevious;
  
  var _react = require("react");
  
  /**
   * A hook that returns the previous value of a component variable
   * This might be provided by React in the future (https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state)
   * @param value The value to track. Will return undefined for first render
   */
  function usePrevious(value) {
    var ref = (0, _react.useRef)();
    (0, _react.useEffect)(() => {
      ref.current = value;
    }, [value]);
    return ref.current;
  }