Skip to content

Commit b38008d

Browse files
author
Emmanouil Konstantinidis
committed
Use PureRenderMixin
1 parent 5caf400 commit b38008d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"octicons": "=3.5.0",
5858
"react": "=15.0.2",
5959
"react-addons-css-transition-group": "=15.0.2",
60+
"react-addons-pure-render-mixin": "=15.0.2",
6061
"react-addons-test-utils": "=15.0.2",
6162
"react-dom": "=15.0.2",
6263
"react-emojione": "=1.1.1",

src/js/components/all-read.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import React from 'react';
21
import _ from 'underscore';
2+
import React from 'react';
3+
import PureRenderMixin from 'react-addons-pure-render-mixin';
34
import malarkey from 'malarkey';
45
import {emojify} from 'react-emojione';
56

67
import constants from '../utils/constants';
78

89
export default class AllRead extends React.Component {
9-
10-
shouldComponentUpdate(nextProps, nextState) {
11-
return false;
10+
constructor(props) {
11+
super(props);
12+
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
1213
}
1314

1415
componentDidMount() {

src/js/components/oops.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import React from 'react';
21
import _ from 'underscore';
2+
import React from 'react';
3+
import PureRenderMixin from 'react-addons-pure-render-mixin';
34
import {emojify} from 'react-emojione';
45

56
import constants from '../utils/constants';
67

78
export default class Oops extends React.Component {
8-
shouldComponentUpdate(nextProps, nextState) {
9-
return false;
9+
constructor(props) {
10+
super(props);
11+
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
1012
}
1113

1214
render() {

0 commit comments

Comments
 (0)