"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
// storing a previous version of a prop for comparison
// similar to the old previousProps param from `componentDidUpdate`
const usePrevious = value => {
  const ref = (0, _react.useRef)();
  (0, _react.useEffect)(() => {
    ref.current = value;
  });
  return ref.current;
};
var _default = exports.default = usePrevious;