Bug 1287613 - New console frontend: use shouldComponentUpdate and add perf test. r=bgrins

This commit is contained in:
Peter Elmers
2016-07-18 14:49:45 -07:00
parent a1063afe52
commit dbefa5e370
3 changed files with 65 additions and 0 deletions

View File

@@ -33,6 +33,10 @@ const MessageContainer = createClass({
message: PropTypes.object.isRequired
},
shouldComponentUpdate(nextProps, nextState) {
return this.props.message.repeat !== nextProps.message.repeat;
},
render() {
const { message } = this.props;
let MessageComponent = createFactory(getMessageComponent(message));