DEV Community

Finn
Finn

Posted on

NextJS Key not working

Hey there! I tried creating an array with nextjs but I always get the error Missing "key" prop for element in iterator. Does anyone know how to fix that error? I really don't know what I did wrong

The code:
Image description

My data: (These aren't real ip adresses)

Image description

Top comments (2)

Collapse
 
jzombie profile image
jzombie • Edited

Move the key up a node.

Example

Collapse
 
codbugs profile image
Coding Bugs

I think you missed the key attribute in the first node inside map function. Take a look on this article I wrote some time ago, it may help you with this, dev.to/codbugs/easiest-way-to-set-....