diff --git a/mobile/components/CommentItem.tsx b/mobile/components/CommentItem.tsx index 6b7ff27c6..8c10aa623 100644 --- a/mobile/components/CommentItem.tsx +++ b/mobile/components/CommentItem.tsx @@ -131,10 +131,11 @@ export default function CommentItem({ const parts: ReactNode[] = []; let lastIndex = 0; let match; + let key = 0; while ((match = mentionRegex.exec(content)) !== null) { if (match.index > lastIndex) { - parts.push(content.slice(lastIndex, match.index)); + parts.push({content.slice(lastIndex, match.index)}); } const [, displayName, userId] = match; parts.push( @@ -152,10 +153,10 @@ export default function CommentItem({ } if (lastIndex < content.length) { - parts.push(content.slice(lastIndex)); + parts.push({content.slice(lastIndex)}); } - return parts.length > 0 ? parts : content; + return parts.length > 0 ? {parts} : {content}; }; return (