Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumReactrecursion in componentsSingle-choice MCQ

A recursive `<TreeNode>` component renders its children by mapping over `node.children` and rendering `<TreeNode>` for each. You forget to add a `key`. Beyond the console warning, what concrete bug is most likely when a node is inserted in the middle of a sibling list?

function TreeNode({ node }) { return ( <li> {node.label} <ul> {node.children.map((c) => ( <TreeNode node={c} /> ))} </ul> </li> ); }