2021
04-07
04-07
React.Children的用法详解
React.Children 是顶层API之一,为处理 this.props.children 这个封闭的数据结构提供了有用的工具。this.props 对象的属性与组件的属性一一对应,但是有一个例外,就是 this.props.children 属性。它表示组件的所有子节点。1、React.Children.mapobjectReact.Children.map(objectchildren,functionfn[,objectcontext])使用方法:React.Children.map(this.props.children,function(child)...
继续阅读 >