@microsoft/sp-dialog
Version:
SharePoint Framework support for displaying dialog boxes
34 lines • 1.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var ContentDiv = /** @class */ (function (_super) {
tslib_1.__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));
exports.default = ContentDiv;
//# sourceMappingURL=ContentDiv.js.map