Forráskód Böngészése

Add key to button list for Recipe Cards

Tatiana Inama 7 éve
szülő
commit
bc6ee6f8d8
1 módosított fájl, 11 hozzáadás és 6 törlés
  1. 11 6
      recipes/src/components/Card/index.tsx

+ 11 - 6
recipes/src/components/Card/index.tsx

@@ -58,14 +58,19 @@ function CBKCard(props: CBKCardProps){
               }
             </CardActionButtons>
             {
-              icons && icons.map((action) => (
+              icons ? (
                 <CardActionIcons>
-                  <Button
-                    icon={action.icon}
-                    onClick={action.handler}
-                  />
+                  {
+                    icons.map((action, i) => (
+                      <Button
+                        icon={action.icon}
+                        onClick={action.handler}
+                        key={i}
+                      />
+                    ))
+                  }
                 </CardActionIcons>
-              ))
+              ) : null
             }
           </CardActions>
         ) :