I\'m building a React Component for rendering an HTML form and I\'m finding the need to recursively iterate through all children of my parent Form component in order to add
This thread actually misses the right answer:
const mapRecursive = (children, callback) => ( React.Children.map( children, child => ( child.props.children ? [callback(child), mapRecursive(child.props.children, callback)] : callback(child) ), ) );