"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`
var usePrevious = function usePrevious(value) {
  var ref = (0, _react.useRef)();
  (0, _react.useEffect)(function () {
    ref.current = value;
  });
  return ref.current;
};

var _default = usePrevious;
exports.default = _default;