From e3fda8e4e8e2945a93d0a41e82c6fe2bd417d391 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Tue, 20 Sep 2016 11:37:01 -0700 Subject: [PATCH] Bug 1300510 - New console frontend: Add a default value for the open prop. r=linclark MozReview-Commit-ID: KwhFDDPpNzJ --- .../new-console-output/components/message-container.js | 6 ++++++ .../components/message-types/console-api-call.js | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/devtools/client/webconsole/new-console-output/components/message-container.js b/devtools/client/webconsole/new-console-output/components/message-container.js index 344e86193bd3..03a43a5ab9d3 100644 --- a/devtools/client/webconsole/new-console-output/components/message-container.js +++ b/devtools/client/webconsole/new-console-output/components/message-container.js @@ -36,6 +36,12 @@ const MessageContainer = createClass({ open: PropTypes.bool.isRequired, }, + getDefaultProps: function () { + return { + open: false + }; + }, + shouldComponentUpdate(nextProps, nextState) { return this.props.message.repeat !== nextProps.message.repeat || this.props.open !== nextProps.open; diff --git a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js index ccc860d7fb3e..baa5535f0610 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js @@ -30,6 +30,10 @@ ConsoleApiCall.propTypes = { open: PropTypes.bool.isRequired, }; +ConsoleApiCall.defaultProps = { + open: false +}; + function ConsoleApiCall(props) { const { dispatch, message, sourceMapService, onViewSourceInDebugger, open } = props; const { source, level, stacktrace, type, frame, parameters } = message;