0 votes
in ReactJS by
What are the conditions to safely use the index as a key in ReactJS, explain with example?

1 Answer

0 votes
by

There are three conditions to make sure, it is safe use the index as a key.

  1. The list and items are static– they are not computed and do not change
  2. The items in the list have no ids
  3. The list is never reordered or filtered.
...