Skip to content

Commit 42a6681

Browse files
author
Ives van Hoorne
committed
Fix rebundling after every dep change
1 parent 88e3964 commit 42a6681

File tree

1 file changed

+6
-1
lines changed
  • src/app/components/sandbox/Preview

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ export default class Preview extends React.PureComponent {
110110
this.state.frameInitialized
111111
) {
112112
if (this.props.preferences.livePreviewEnabled) {
113-
this.executeCode();
113+
if (
114+
this.props.bundle === prevProps.bundle || // So we don't trigger after every dep change
115+
this.props.sandboxId !== prevProps.sandboxId
116+
) {
117+
this.executeCode();
118+
}
114119
}
115120
}
116121
}

0 commit comments

Comments
 (0)