reactjs/react-tutorial

What is the purpose of 'key' in example.js?

Closed this issue · 1 comments

Not an issue.
What is the purpose of key in <Comment author={comment.author} key={comment.id}> ?

zpao commented

This is explained further in the documentation. It's for uniquely identifying components to avoid issues with updating. https://facebook.github.io/react/docs/multiple-components.html#dynamic-children