Skip to content

Card component have warning message "Each child in a list should have a unique "key" prop." #2515

Answered by cuetrigg
ComputerFrek asked this question in Q&A
Discussion options

You must be logged in to vote

@ComputerFrek I am sill note sure by the snippet you provided that you are using an underlying loop of some sort, but you can attempt to add the key prop to your card component like this: <Card key={id} content={foodbody} footer={foodfooter} />;, but for it to work the id needs to be unique.

For a more in depth guide you can go and read here

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ComputerFrek
Comment options

@frankcalise
Comment options

Answer selected by frankcalise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants
Converted from issue

This discussion was converted from issue #2512 on October 08, 2023 09:46.