gatsby-style-guide-guide icon indicating copy to clipboard operation
gatsby-style-guide-guide copied to clipboard

PrimaryNav: Each child in array should have unique "key"

Open poohbers opened this issue 7 years ago • 0 comments

React Console warning

This is a small bug in the PrimaryNav.js component, but wanted to share. Basically you need to add a key prop whenever you are mapping an array. For me, I'm simply using key={post.frontmatter.title}. This works for my project but probably not a great long term solution.

code example of implementing the key prop

I added the key prop within the map function.

poohbers avatar Jul 23 '18 17:07 poohbers