Skip to content

Commit fd8b36e

Browse files
committed
Use React.PureComponent instead of reimplementing it
1 parent 04b1678 commit fd8b36e

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

‎src/components/views/rooms/DNDRoomTile.js‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import RoomTile from 'matrix-react-sdk/lib/components/views/rooms/RoomTile';
2020

2121
import classNames from 'classnames';
2222

23-
export default class DNDRoomTile extends React.Component {
23+
export default class DNDRoomTile extends React.PureComponent {
2424
constructor() {
2525
super();
2626
this.getClassName = this.getClassName.bind(this);
@@ -33,17 +33,6 @@ export default class DNDRoomTile extends React.Component {
3333
});
3434
}
3535

36-
shouldComponentUpdate(nextProps, nextState) {
37-
// Do a shallow comparison of the props that we pass through (there is no
38-
// state to check).
39-
// NB: We might want to ignore changes to index in future if reordering
40-
// occurs (all indices of all tiles in the sublist will change).
41-
if (Object.keys(nextProps).some((k) => nextProps[k] !== this.props[k])) {
42-
return true;
43-
}
44-
return false;
45-
}
46-
4736
render() {
4837
const props = this.props;
4938

0 commit comments

Comments
 (0)