Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
poohbers opened this issue Jul 23, 2018 · 0 comments
Open

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

poohbers opened this issue Jul 23, 2018 · 0 comments

Comments

@poohbers
Copy link

poohbers commented Jul 23, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant