Fix duplicate keys in CombinedSystemMessage component (#23507)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fa1ba4717b
Коммит
eaa190acf6
@@ -322,14 +322,15 @@ export class CombinedSystemMessage extends React.PureComponent<Props> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderMessage(postType: string, userIds: string[], actorId?: string): JSX.Element {
|
renderMessage(index: number, postType: string, userIds: string[], actorId?: string): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<React.Fragment key={postType + actorId}>
|
<React.Fragment key={index}>
|
||||||
{this.renderFormattedMessage(postType, userIds, actorId)}
|
{this.renderFormattedMessage(postType, userIds, actorId)}
|
||||||
<br/>
|
<br/>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): JSX.Element {
|
render(): JSX.Element {
|
||||||
const {
|
const {
|
||||||
currentUserId,
|
currentUserId,
|
||||||
@@ -337,7 +338,8 @@ export class CombinedSystemMessage extends React.PureComponent<Props> {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const content = [];
|
const content = [];
|
||||||
for (const message of messageData) {
|
for (let i = 0; i < messageData.length; i++) {
|
||||||
|
const message = messageData[i];
|
||||||
const {
|
const {
|
||||||
postType,
|
postType,
|
||||||
actorId,
|
actorId,
|
||||||
@@ -356,7 +358,7 @@ export class CombinedSystemMessage extends React.PureComponent<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
content.push(this.renderMessage(postType, userIds, actorId));
|
content.push(this.renderMessage(i, postType, userIds, actorId));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user