Concept
Map an array to elements to render a list, and give each one a stable key so React can match items across renders. The key tells React which item moved, appeared or disappeared.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Rendering lists and keys doing its job.
function TodoList({ todos }: { todos: { id: string; text: string }[] }) {
return (
<ul>
{todos.map((todo) => (
<li key={todo.id}>{todo.text}</li>
))}
</ul>
);
}Using the array index as the key for a list that can reorder or delete. React then reuses the wrong DOM nodes and state, so a checkbox or input appears to jump to a different item.
Your roadmap puts these before Rendering lists and keys, unless you already know them.
Once a session shows you understand Rendering lists and keys, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.