UNPKG

cosmo-ui

Version:
26 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var React = require("react"); var cx = require("classnames"); var styles = require('../../src/styles/components/scroll-container.scss'); var ScrollContainer = (function (_super) { tslib_1.__extends(ScrollContainer, _super); function ScrollContainer() { return _super !== null && _super.apply(this, arguments) || this; } ScrollContainer.prototype.componentDidUpdate = function () { if (this.props.scrollTop) { this.scrollContainer.scrollTop = this.props.scrollTop; } }; ScrollContainer.prototype.render = function () { var _this = this; /* tslint:disable:jsx-no-lambda */ return (React.createElement("div", { ref: function (e) { return _this.scrollContainer = e; }, className: cx(styles.container, this.props.className), style: this.props.style }, this.props.children)); /* tslint:enable:jsx-no-lambda */ }; return ScrollContainer; }(React.Component)); exports.ScrollContainer = ScrollContainer; //# sourceMappingURL=scroll-container.js.map