Skip to content

Commit 5caf400

Browse files
author
Emmanouil Konstantinidis
committed
Prevent static components from updating
1 parent 938908c commit 5caf400

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/js/components/all-read.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import constants from '../utils/constants';
77

88
export default class AllRead extends React.Component {
99

10+
shouldComponentUpdate(nextProps, nextState) {
11+
return false;
12+
}
13+
1014
componentDidMount() {
1115
const message = _.sample(constants.ALLREAD_MESSAGES);
1216

src/js/components/oops.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import {emojify} from 'react-emojione';
55
import constants from '../utils/constants';
66

77
export default class Oops extends React.Component {
8+
shouldComponentUpdate(nextProps, nextState) {
9+
return false;
10+
}
11+
812
render() {
913
const emoji = _.sample(constants.ERROR_EMOJIS);
1014

0 commit comments

Comments
 (0)