You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-13 23:41:50 +03:00
Add shouldComponentUpdate() methods to RoomView and TimelinePanel
This will avoid re-rendering the whole RoomView every time we get a scroll event, and might even help with https://github.com/vector-im/vector-web/issues/1056.
This commit is contained in:
@ -38,6 +38,7 @@ var SlashCommands = require("../../SlashCommands");
|
||||
var dis = require("../../dispatcher");
|
||||
var Tinter = require("../../Tinter");
|
||||
var rate_limited_func = require('../../ratelimitedfunc');
|
||||
var ObjectUtils = require('../../ObjectUtils');
|
||||
|
||||
var DEBUG = false;
|
||||
|
||||
@ -164,6 +165,11 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
shouldComponentUpdate: function(nextProps, nextState) {
|
||||
return (!ObjectUtils.shallowEqual(this.props, nextProps) ||
|
||||
!ObjectUtils.shallowEqual(this.state, nextState));
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
// set a boolean to say we've been unmounted, which any pending
|
||||
// promises can use to throw away their results.
|
||||
|
Reference in New Issue
Block a user