Flatten arrays of components before adding to messagepanel li
Avoid updating the whole DOM when we paginating by making sure the keys are rightpull/21833/head
parent
05a3dab528
commit
6e86d7553f
|
@ -198,7 +198,10 @@ module.exports = React.createClass({
|
||||||
var last = (i == lastShownEventIndex);
|
var last = (i == lastShownEventIndex);
|
||||||
|
|
||||||
if (wantTile) {
|
if (wantTile) {
|
||||||
ret.push(this._getTilesForEvent(prevEvent, mxEv, last));
|
// make sure we unpack the array returned by _getTilesForEvent,
|
||||||
|
// otherwise react will auto-generate keys and we will end up
|
||||||
|
// replacing all of the DOM elements every time we paginate.
|
||||||
|
ret.push(...this._getTilesForEvent(prevEvent, mxEv, last));
|
||||||
prevEvent = mxEv;
|
prevEvent = mxEv;
|
||||||
} else if (!mxEv.status) {
|
} else if (!mxEv.status) {
|
||||||
// if we aren't showing the event, put in a dummy scroll token anyway, so
|
// if we aren't showing the event, put in a dummy scroll token anyway, so
|
||||||
|
|
Loading…
Reference in New Issue