@fluentui/react-northstar
Version:
A themable React component library.
33 lines (32 loc) • 1.14 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
import * as React from 'react';
export var ScrollToBottom = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(ScrollToBottom, _React$Component);
function ScrollToBottom() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.ref = /*#__PURE__*/React.createRef();
return _this;
}
var _proto = ScrollToBottom.prototype;
_proto.componentDidMount = function componentDidMount() {
this.scrollToBottom();
};
_proto.scrollToBottom = function scrollToBottom() {
this.ref.current.scrollTo({
behavior: 'smooth',
top: 999999
});
};
_proto.render = function render() {
return /*#__PURE__*/React.createElement("div", _extends({
ref: this.ref
}, this.props));
};
return ScrollToBottom;
}(React.Component);
//# sourceMappingURL=ScrollToBottom.js.map