Skip to content

Commit c45c365

Browse files
committed
Fix redundant renders on TimeSince component
1 parent 1b0ba9d commit c45c365

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/sentry/static/sentry/app/components/timeSince.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import React from "react";
22
import moment from "moment";
3+
import PureRenderMixin from 'react-addons-pure-render-mixin';
34

45
var TimeSince = React.createClass({
6+
mixins: [
7+
PureRenderMixin
8+
],
9+
510
propTypes: {
611
date: React.PropTypes.any.isRequired,
712
suffix: React.PropTypes.string
@@ -31,10 +36,6 @@ var TimeSince = React.createClass({
3136
this.forceUpdate();
3237
},
3338

34-
shouldComponentUpdate(nextProps, nextState) {
35-
return this.props.date !== nextProps.date;
36-
},
37-
3839
render() {
3940
var date = this.props.date;
4041

0 commit comments

Comments
 (0)