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

Each child in an array or iterator should have a unique "key" prop. #44

Open
mastershaig opened this issue May 1, 2017 · 5 comments
Open

Comments

@mastershaig
Copy link

I'm new to React js and wanted to run 5-redux-react code. But when I clicked Load tweets button, nothing happened and below error on console:

Each child in an array or iterator should have a unique "key" prop. Check the render method of Layout. See https://fb.me/react-warning-keys for more information.

screen shot 2017-05-02 at 1 31 15 am

@FelipeBarrosCruz
Copy link

I'm fix in my pull request: #45

@mastershaig
Copy link
Author

@FelipeBarrosCruz thanks ! But can you explain why it worked before and why this error happened
now?

@willrstern
Copy link
Collaborator

I added a comment here https://github.com/learncodeacademy/react-js-tutorials/blob/master/5-redux-react/src/js/actions/tweetsActions.js

Since we load "tweets" from rest.learncode.academy where anyone can update data, sometimes people post bad data that breaks the app...just change the user namespace to something unique and post your own data.

@willrstern
Copy link
Collaborator

The unique key isn't a fatal error, just a warning that performance will be slow without a unique key for each item

@mastershaig
Copy link
Author

@willrstern thanks !

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

3 participants