@microsoft/sp-dialog
Version:
SharePoint Framework support for displaying dialog boxes
32 lines • 1.22 kB
JavaScript
import { __extends } from "tslib";
import * as React from 'react';
var ContentDiv = /** @class */ (function (_super) {
__extends(ContentDiv, _super);
function ContentDiv(props) {
var _this = _super.call(this, props) || this;
_this._divRef = React.createRef();
return _this;
}
ContentDiv.prototype.render = function () {
return React.createElement("div", { "data-automation-id": 'sp-dialog-content-div', ref: this._divRef });
};
ContentDiv.prototype.componentDidUpdate = function () {
if (this.props.innerElement && this._divRef.current) {
this._divRef.current.innerHTML = '';
this._divRef.current.appendChild(this.props.innerElement);
}
};
ContentDiv.prototype.componentWillUnmount = function () {
if (this._divRef.current) {
this._divRef.current.innerHTML = '';
}
};
ContentDiv.prototype.componentDidMount = function () {
if (this.props.innerElement && this._divRef.current) {
this._divRef.current.appendChild(this.props.innerElement);
}
};
return ContentDiv;
}(React.Component));
export default ContentDiv;
//# sourceMappingURL=ContentDiv.js.map