What is the point of giving keys

Tell us what’s happening:
What is the point of giving keys. How can we use these keys?

  **Your code so far**

const frontEndFrameworks = [
'React',
'Angular',
'Ember',
'Knockout',
'Backbone',
'Vue'
];

function Frameworks() {
const renderFrameworks = frontEndFrameworks.map(x => <li key={x}>{x}</li>)
return (
  <div>
    <h1>Popular Front End JavaScript Frameworks</h1>
    <ul>
      {renderFrameworks}
    </ul>
  </div>
);
};
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36

Challenge: Give Sibling Elements a Unique Key Attribute

Link to the challenge:

We never use them. React uses them to render efficiently. That’s why they need to be unique and unchanging (for a specific element). But no, you don’t use them directly. I don’t even think you can access them.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.