"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useScrollContext = exports.ScrollContext = void 0;
var _react = _interopRequireWildcard(require("react"));
const ScrollContext = exports.ScrollContext = /*#__PURE__*/_react.default.createContext(null);
const useScrollContext = () => {
  const context = (0, _react.useContext)(ScrollContext);
  if (!context) {
    throw new Error('The \`useScrollContext\` hook must be used inside the <ScrollContext> component\'s context.');
  }
  const {
    scrollRef
  } = context;
  return scrollRef;
};
exports.useScrollContext = useScrollContext;