Keys
Why are keys important?
Rules of keys
Every key in a list of children must be keyed.
Each key must be unique amongst its siblings. This is intuitive, because the key is what marks a nodes identity
How to use keys
import { b, SFC } from "baahu";
const myTodoList = [
{ id: "uno", todo: "wake up" },
{ id: "dos", todo: "brush teeth" },
{ id: "tres", todo: "eat breakfast" },
];
const TodoList: SFC = () => (
<div>
<h3 key="header">TodoList</h3>
{myTodoList.map((item) => (
<p key={item.id}>{item.todo}</p>
))}
</div>
);