Recursion is too easy for writing nested menus in UI

Hannah Höch, Für ein Fest gemacht (Made for a Party), 1936 Collage

When paired with component-based framework tools and HTML’s unordered lists. Since the rendering is done by the framework, we simply need to progressively stack render calls as we traverse the data. Such brutalist Dada.

function List({ items }) {
  return items.map((item) => (
    <ul key={item.id}>
      <li>{item.name}</li>
      {item.children && <List expanded={expanded} items={item.children} />}
    </ul>
  ));
}
Ross Chapman @internetross