06-components/ListBox.tsx
List Box
Support
Support source used by the official components examples.
export type Props<Item> = {
items: Item[];
keyOf: (item: Item) => string | number;
item: (item: Item, index: number) => View;
};
export default <Item,>(props: Props<Item>) => (
<ul>
{props.items.map((value, index) => (
<li key={props.keyOf(value)}>{props.item(value, index)}</li>
))}
</ul>
);