Remove key caching from Timeline

This commit is contained in:
Fedor Indutny 2021-09-28 11:32:54 -07:00 committed by GitHub
parent 1303fd009e
commit 2f7226e200
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View file

@ -752,7 +752,6 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
const typingBubbleRow = this.getTypingBubbleRow();
let rowContents: ReactNode;
let stableKey = key;
if (haveOldest && row === 0) {
rowContents = (
<div data-row={row} style={styleWithWidth} role="row">
@ -800,7 +799,6 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
const previousMessageId: undefined | string = items[itemIndex - 1];
const messageId = items[itemIndex];
const nextMessageId: undefined | string = items[itemIndex + 1];
stableKey = messageId;
const actionProps = getActions(this.props);
@ -831,7 +829,7 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
<CellMeasurer
cache={this.cellSizeCache}
columnIndex={0}
key={stableKey}
key={key}
parent={parent}
rowIndex={index}
width={this.mostRecentWidth}