@atlaskit/modal-dialog
Version:
A modal dialog displays content that requires user interaction, in a layer above the page.
19 lines (18 loc) • 588 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = useScroll;
var _react = require("react");
var _context = require("../context");
/**
* This returns whether or not scrolling is allowed based on the existing
* scrolling context.
*/
function useScroll() {
var shouldScrollInViewport = (0, _react.useContext)(_context.ScrollContext);
if (shouldScrollInViewport == null) {
throw Error('@atlaskit/modal-dialog: Scroll context unavailable – this component needs to be a child of ModalDialog.');
}
return shouldScrollInViewport;
}