Practice
A
Most often we use identifiers from our data as keys :
const todoItems = todos.map((todo) =>
<li key={todo.id}>
{todo.text}
</li>
)
If you don't have stable identifiers for the items being rendered, you can use the item's index as the key as a last resort:
const todoItems = todos . map (( todo , index ) => < li key = { index } > { todo . text } </ li > )
Notes:
Sign in and the lectures you have studied will be marked in this list.
Choose a course
Comments