map() e keys
const tarefas = [
{ id: 1, texto: "Estudar React" },
{ id: 2, texto: "Fazer projecto" },
];
function Lista() {
return (
<ul>
{tarefas.map(t => (
<li key={t.id}>{t.texto}</li>
))}
</ul>
);
}
key = único e estável (preferir ID, não index).