Skip to content

Commit 2236259

Browse files
christianalfoniSaraVieira
authored andcommitted
Prevent clearing logs in development (codesandbox#3248)
1 parent 82f81a0 commit 2236259

File tree

1 file changed

+5
-1
lines changed
  • packages/common/src/components/Preview

1 file changed

+5
-1
lines changed

packages/common/src/components/Preview/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,11 @@ class BasePreview extends React.Component<Props, State> {
414414
const { settings } = this.props;
415415
const { sandbox } = this.props;
416416

417-
if (settings.clearConsoleEnabled && !this.serverPreview) {
417+
if (
418+
process.env.NODE_ENV !== 'development' &&
419+
settings.clearConsoleEnabled &&
420+
!this.serverPreview
421+
) {
418422
// @ts-ignore Chrome behaviour
419423
console.clear('__internal__'); // eslint-disable-line no-console
420424
dispatch({ type: 'clear-console' });

0 commit comments

Comments
 (0)