Merge pull request #1490 from ghalestrilo/fix/mobile-crash-on-leave-preview
Fixes #1487
This commit is contained in:
commit
97c3b3549c
1 changed files with 2 additions and 1 deletions
|
@ -64,7 +64,8 @@ class PreviewFrame extends React.Component {
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
window.removeEventListener('message', this.handleConsoleEvent);
|
window.removeEventListener('message', this.handleConsoleEvent);
|
||||||
ReactDOM.unmountComponentAtNode(this.iframeElement.contentDocument.body);
|
const iframeBody = this.iframeElement.contentDocument.body;
|
||||||
|
if (iframeBody) { ReactDOM.unmountComponentAtNode(iframeBody); }
|
||||||
}
|
}
|
||||||
|
|
||||||
handleConsoleEvent(messageEvent) {
|
handleConsoleEvent(messageEvent) {
|
||||||
|
|
Loading…
Reference in a new issue