Skip to content

Avoid re-rendering RoomList on room switch#5015

Merged
dbkr merged 3 commits intodevelopfrom
dbkr/active_room_observer
Sep 11, 2017
Merged

Avoid re-rendering RoomList on room switch#5015
dbkr merged 3 commits intodevelopfrom
dbkr/active_room_observer

Conversation

@dbkr
Copy link
Copy Markdown
Member

@dbkr dbkr commented Sep 11, 2017

Comment thread src/components/structures/LeftPanel.js Outdated
},
shouldComponentUpdate: function(nextProps, nextState) {
// MatrixChat will update whenever the user switches
// rooms, but propagating this chnage all the way down
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change

// here. The RoomTiles listen for the room change
// events themselves to know when to update.
// We just need to update if any of these things change.
if (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want an XXX to spell out that if we add new props, we have to update the shouldComponentUpdate (either here or in the props definition)

@ara4n
Copy link
Copy Markdown
Member

ara4n commented Sep 11, 2017

lgtm, modulo minor niggles

@dbkr dbkr merged commit f18f136 into develop Sep 11, 2017
@t3chguy t3chguy deleted the dbkr/active_room_observer branch May 12, 2022 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants