📜  反应递归组件 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:41.461000             🧑  作者: Mango

代码示例1
const RecursiveComponent = ({ name, items }) => {
  const hasChildren = items && items.length

  return (
    <>
      {name}
      {hasChildren && items.map((item) => (
        
      ))}
    
  )
}