Skip to content

Commit 0682c04

Browse files
author
Ives van Hoorne
committed
Move listener
1 parent 8054326 commit 0682c04

File tree

1 file changed

+2
-4
lines changed
  • packages/app/src/app/components/Preview

1 file changed

+2
-4
lines changed

packages/app/src/app/components/Preview/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class BasePreview extends React.Component<Props, State> {
5858
// when the user navigates the iframe app, which shows the loading screen
5959
this.initialPath = props.initialPath;
6060

61+
this.listener = listen(this.handleMessage);
62+
6163
if (props.delay) {
6264
this.executeCode = debounce(this.executeCode, 800);
6365
}
@@ -81,10 +83,6 @@ class BasePreview extends React.Component<Props, State> {
8183
}
8284
}
8385

84-
componentDidMount() {
85-
this.listener = listen(this.handleMessage);
86-
}
87-
8886
openNewWindow = () => {
8987
if (this.props.onOpenNewWindow) {
9088
this.props.onOpenNewWindow();

0 commit comments

Comments
 (0)