Baahu

Baahu

  • Docs
  • API
  • Github
  • Blog

›Core Concepts

Getting Started

  • Introduction/Pitch
  • Setup

Core Concepts

  • VNodes and SFCs
  • Machines
  • Keys
  • Routing & Code-Splitting
  • Performance
  • SSR
  • Testing
  • Forms

Tutorials

  • SoundCloud Clone

API Reference

  • Cheat Sheet

Keys

Why are keys important?

View full image

keys

Rules of keys

  1. Every key in a list of children must be keyed.

  2. 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>
);
← MachinesRouting & Code-Splitting →
  • Why are keys important?
  • Rules of keys
  • How to use keys
Baahu
Docs
Getting StartedGuidesAPI Reference
More
BlogGitHub
Copyright © 2020 TJ Kandala