When working with lists, some common operations would include the following:

  • Adding items 
  • Editing items 
  • Removing items 
  • Sorting lists by a particular property

You have learned that React has declarative programming that keeps your UI elements in sync with your data. This also means that whenever you update your list data, React uses its reconciliation algorithm to track and update your interface.
This is where the key attribute comes into the picture. This attribute requires a String value that must be unique for every item in the collection.