فهرست منبع

use spread syntax to fix bug in PageCommentList

yuto-oweseek 4 سال پیش
والد
کامیت
fc43c931bd
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      packages/app/src/components/PageCommentList.tsx

+ 1 - 2
packages/app/src/components/PageCommentList.tsx

@@ -86,8 +86,7 @@ const PageCommentList:FC<Props> = memo((props:Props):JSX.Element => {
           return preprocessComment(highlightedComment);
           return preprocessComment(highlightedComment);
         }));
         }));
         const preprocessedComments: ICommentHasIdList = comments.map((comment, index) => {
         const preprocessedComments: ICommentHasIdList = comments.map((comment, index) => {
-          comment.comment = preprocessedCommentList[index];
-          return comment;
+          return { ...comment, comment: preprocessedCommentList[index] };
         });
         });
         setFormatedComments(preprocessedComments);
         setFormatedComments(preprocessedComments);
       }
       }