Suddenly I am having a blank modal on main modal. No clue where it’s coming from. I am using 1.17.4 for both microsoft/sp-core-library and microsoft/sp-dialog.
My dialog page code looks like this. App component is veary simple, just showing a message.
import * as React from "react";
import * as ReactDOM from "react-dom";
import App from "./App";
import { override } from "@microsoft/decorators";
export default class MainDialog extends BaseDialog {
public render(): void {
const app = <App close={this.close} />;
const interval = setInterval(() => {
if (this.domElement) {
ReactDOM.render(app, this.domElement);
clearInterval(interval);
}
});
}
public getConfig(): IDialogConfiguration {
return {
isBlocking: true,
};
}
@override
protected onBeforeOpen(): Promise<void> {
return new Promise((resolve, reject) => {
window.setTimeout(() => resolve(), 1);
});
}
protected onAfterClose(): void {
super.onAfterClose();
ReactDOM.unmountComponentAtNode(this.domElement);
}
} ```