🐛 <PreviewFrame /> check for own iframe body tag before unmounting it

This commit is contained in:
ghalestrilo 2020-07-03 14:40:20 -03:00
parent 69bd6cb4a0
commit 835a553bf9

View file

@ -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) {