chat: key mapped components

This commit is contained in:
Matilde Park 2021-03-11 13:27:14 -05:00
parent 7f67682297
commit 3d46b16a26
2 changed files with 6 additions and 3 deletions

View File

@ -408,6 +408,7 @@ export const Message = ({
case 'text':
return (
<TextContent
key={i}
api={api}
fontSize={1}
lineHeight={'20px'}
@ -415,10 +416,11 @@ export const Message = ({
/>
);
case 'code':
return <CodeContent content={content} />;
return <CodeContent key={i} content={content} />;
case 'url':
return (
<Box
key={i}
flexShrink={0}
fontSize={1}
lineHeight='20px'
@ -455,6 +457,7 @@ export const Message = ({
const first = (i) => (i === 0);
return (
<Mention
key={i}
first={first(i)}
group={group}
scrollWindow={scrollWindow}

View File

@ -91,7 +91,7 @@ const MessageMarkdown = React.memo((props) => {
}, []);
return lines.map((line, i) => (
<>
<React.Fragment key={i}>
{i !== 0 && <Row height={2} />}
<ReactMarkdown
{...rest}
@ -123,7 +123,7 @@ const MessageMarkdown = React.memo((props) => {
]
]}
/>
</>
</React.Fragment>
));
});