About Listings in ReactJS

In ReactJS if you have a list of items, for each item you will need to set a unique key attribute. Don't use the index for the key when allowing to remove list items – removing siblings will get messed up. Use object ids for the keys instead.

1
2
3
4
5
const items_html = items.map((item) =>
  <li key={item.id}>
    {item.title}
  </li>
);

Tips and Tricks Programming JavaScript