🐛 <PreviewFrame /> check for own iframe body tag before unmounting it
This commit is contained in:
parent
69bd6cb4a0
commit
835a553bf9
1 changed files with 2 additions and 1 deletions
|
@ -64,7 +64,8 @@ class PreviewFrame extends React.Component {
|
|||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener('message', this.handleConsoleEvent);
|
||||
ReactDOM.unmountComponentAtNode(this.iframeElement.contentDocument.body);
|
||||
const iframeBody = this.iframeElement.contentDocument.body;
|
||||
if (iframeBody) { ReactDOM.unmountComponentAtNode(iframeBody); }
|
||||
}
|
||||
|
||||
handleConsoleEvent(messageEvent) {
|
||||
|
|
Loading…
Reference in a new issue