Next.js Discord

Discord Forum

Warning: Each child in a list should have a unique "key" prop.

Answered
Dabi πŸͺ posted this in #help-forum
Open in Discord
I have no idea what is that warning and idk if it affects the deployment of the website, cuz I'm having issues deploying it and idk the issues lol
Answered by Dabi πŸͺ
Actually i think i solved the issue, i was using the id in the wrong place lol, i wasn't able to build before, now its getting built well waiting for the deployment
View full answer

9 Replies

@Dabi πŸͺ I have no idea what is that warning and idk if it affects the deployment of the website, cuz I'm having issues deploying it and idk the issues lol
it does not affect the deployment part. It's a react warning, that you should give each element inside a loop a unique key. React does this, to identify changes inside your map
but every element i used in a loop has a unique key, thats the confusing part
@B33fb0n3 can you share some code?
that warning is related to maps right?
@B33fb0n3 can you share some code?
also the issue is, it doesn't show me where is the bug
@Dabi πŸͺ that warning is related to maps right?
yea, everywhere where you use a loop to create mutliple elements. Could also be a for loop. Or a .map loop or whatever loop you have that#s causing the issue
@Dabi πŸͺ also the issue is, it doesn't show me where is the bug
Normally you know where you were working on, when the error is appeared. So take a look in your project and check where you using loops and where you might don't provide a key. Also keep in mind, that your own components can't get them as props
@B33fb0n3 yea, everywhere where you use a loop to create mutliple elements. Could also be a for loop. Or a .map loop or whatever loop you have that#s causing the issue
Actually i think i solved the issue, i was using the id in the wrong place lol, i wasn't able to build before, now its getting built well waiting for the deployment
Answer
its deployed yaay