"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useInitScrollRef = void 0;
var _react = require("react");
var useInitScrollRef = exports.useInitScrollRef = function useInitScrollRef(element) {
  var invert = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var ref = (0, _react.useRef)(element);
  (0, _react.useEffect)(function () {
    if (ref.current) {
      ref.current.scrollTop = invert ? -1 : 1;
      ref.current.scrollTop = 0;
      ref.current.scrollLeft = invert ? -1 : 1;
      ref.current.scrollLeft = 0;
    }
  }, [invert]);
  return ref;
};
//# sourceMappingURL=useInitScrollRef.js.map