Browse Source

添加唯一key

visuddhinanda 2 years ago
parent
commit
61861992a6
1 changed files with 5 additions and 5 deletions
  1. 5 5
      dashboard/src/components/dict/Community.tsx

+ 5 - 5
dashboard/src/components/dict/Community.tsx

@@ -134,7 +134,7 @@ const CommunityWidget = ({ word }: IWidget) => {
     (value, index: number) => !isShow(value.score, index)
     (value, index: number) => !isShow(value.score, index)
   );
   );
   const meaningExtra = meaningLow?.map((item, id) => {
   const meaningExtra = meaningLow?.map((item, id) => {
-    return <>{item.value}</>;
+    return <span key={id}>{item.value}</span>;
   });
   });
 
 
   const mainCollaboratorNum = 3; //默认显示的协作者数量,其余的在更多中显示
   const mainCollaboratorNum = 3; //默认显示的协作者数量,其余的在更多中显示
@@ -173,7 +173,7 @@ const CommunityWidget = ({ word }: IWidget) => {
       <Title level={5} id={`community`}>
       <Title level={5} id={`community`}>
         {"社区字典"}
         {"社区字典"}
       </Title>
       </Title>
-      <div>
+      <div key="meaning">
         <Space>
         <Space>
           {"意思:"}
           {"意思:"}
           {wordData?.meaning
           {wordData?.meaning
@@ -200,7 +200,7 @@ const CommunityWidget = ({ word }: IWidget) => {
           ) : undefined}
           ) : undefined}
         </Space>
         </Space>
       </div>
       </div>
-      <div>
+      <div key="grammar">
         <Space>
         <Space>
           {"语法:"}
           {"语法:"}
           {wordData?.grammar
           {wordData?.grammar
@@ -238,7 +238,7 @@ const CommunityWidget = ({ word }: IWidget) => {
             })}
             })}
         </Space>
         </Space>
       </div>
       </div>
-      <div>
+      <div key="base">
         <Space>
         <Space>
           {"词干:"}
           {"词干:"}
           {wordData?.parent
           {wordData?.parent
@@ -253,7 +253,7 @@ const CommunityWidget = ({ word }: IWidget) => {
             })}
             })}
         </Space>
         </Space>
       </div>
       </div>
-      <div>
+      <div key="collaborator">
         <Space>
         <Space>
           {"贡献者:"}
           {"贡献者:"}
           {wordData?.editor
           {wordData?.editor